T09 · Insecure Skill Coding Practices
- Location
scripts/screenshot.js:41- Finding
OS Command Injection Through the User-Controlled Search Query
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill appears intended to make a business-opportunity report and screenshot, but its script can run unintended system commands and write files outside intended folders when given crafted inputs.
Review before installing. Only run this in a restricted workspace with trusted arguments, and avoid using a browser profile containing sensitive sessions. The script should be fixed to use argument-array process execution, validate slugs and filenames, escape HTML output, close the Chromium process, and update or pin dependencies from an approved registry.
scripts/screenshot.js:41OS Command Injection Through the User-Controlled Search Query
scripts/screenshot.js:68OS Command Injection Through ClawHub-Provided Skill Slugs
scripts/screenshot.js:306Arbitrary File Placement Through Output Name Path Traversal
scripts/screenshot.js:131HTML and Script Injection in the Generated Report
${s.summary}
${escapeHtml(s.summary)}
``` Additional controls should include: 1. Prefer a DOM builder that assigns untrusted values through `textContent`. 2. Disable JavaScript on the Puppeteer page if report scripting is unnecessary. 3. Add a restrictive Content Security Policy that disallows inline scripts and unnecessary network destinations. 4. Validate and limit the length of every external metadata field. 5. Avoid loading the report in a persistent browser profile containing authenticated sessions or sensitive state. 6. Add tests covering tags, quotes, event handlers, and encoded markup in every rendered field. ]]>package-lock.json:16Dependency Lockfile Uses a Non-Default Package Registry Mirror
Referenced artifact was not completely inspected
node scripts/screenshot.js
Referenced artifact was not completely inspected
node scripts/screenshot.js
Referenced artifact was not completely inspected
node scripts/screenshot.js
The lockfile pins basic-ftp to 5.2.0, which is flagged with multiple advisories including FTP command injection and denial-of-service issues. Although this package is only a transitive dependency here (via get-uri/pac-proxy-agent/proxy-agent in the Puppeteer stack), keeping a known vulnerable version in the dependency tree creates risk if any code path allows attacker-influenced FTP/PAC URI handling.
extract-zip 2.0.1 is present as a transitive dependency and has advisories for arbitrary file write and symlink path traversal during archive extraction. In this dependency graph it is brought in by @puppeteer/browsers, so if the skill ever downloads and extracts browser archives or other attacker-influenced ZIP content, exploitation could lead to writes outside the intended directory.
ip-address 10.1.0 is a known vulnerable transitive dependency through socks/socks-proxy-agent/proxy-agent. The listed issues require specific use of IP parsing or HTML-emitting methods; in this lockfile-only context there is no evidence the vulnerable functionality is actually exercised, but the dependency is still genuinely vulnerable and could become reachable if proxy parsing or related output handling is used.
ws 8.19.0 is included by puppeteer-core and is flagged for memory disclosure and memory exhaustion denial-of-service vulnerabilities. Because Puppeteer communicates with browser/debugging endpoints over WebSocket, a vulnerable ws version can matter if the skill connects to untrusted or attacker-controlled endpoints, making the issue more relevant than a dormant utility dependency.
The HTML output explicitly sets lang="zh-CN" and the visible UI text throughout the report is in Chinese, which forces a specific language/locale. There is no opt-in, fallback, or documented region-specific justification in the file, so this matches the language/locale policy concern.
The dependency is version-ranged with a caret (^24.39.1), so installs may resolve to newer minor/patch releases over time rather than a single audited artifact. This creates a software supply chain risk: a compromised or breaking upstream release could be pulled in automatically, reducing build reproducibility and potentially introducing vulnerable code into the skill.
"license": "ISC",
"type": "commonjs",
"dependencies": {
"puppeteer-core": "^24.39.1"
}
}
The script creates a new HTML file under the workspace via fs.writeFileSync, which is a file-write operation covered by the warning rule for code files. Although there is an informational log after the write, there is no prior disclosure, confirmation, or inline documentation warning that the script will create artifacts in the user's workspace.
The code creates the output directory and writes a screenshot image to disk, which affects user files and storage. The later success log confirms the action after it occurs, but the file lacks any explicit warning or descriptive comment near entrypoint behavior that screenshots and directories will be created.
Detected: suspicious.dangerous_exec