T08 · Insecure Dependencies
Warning
- Location
- setup.md:23
- Finding
- Unpinned npm Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `setup.md:23-32` **Vulnerability Type**: Unpinned third-party dependency installation **Risk Level**: Medium ### Vulnerable Code ```markdown Check their setup: - Node.js installed? (`node --version`) - Puppeteer installed? (`npm list puppeteer`) If not installed: ```bash npm install puppeteer # or for lighter install (uses system Chrome): npm install puppeteer-core ``` ``` ### Technical Analysis The setup instructions install `puppeteer` or `puppeteer-core` without specifying an exact version, lockfile, integrity hash, or trusted package snapshot. Consequently, npm resolves whichever compatible package release and transitive dependency graph are current when the command runs. npm packages may execute lifecycle or installation scripts with the privileges of the invoking user. Puppeteer installation may also download browser components. If the upstream package, maintainer account, package registry, or a transitive dependency is compromised, the effective code executed by this Skill can differ from the code reviewed during the audit. This is a supply-chain weakness rather than evidence that the named packages are currently malicious. ### Attack Path 1. An Agent loads the Skill on a system where Puppeteer is not installed. 2. The Agent follows the setup instructions and runs `npm install puppeteer` or `npm install puppeteer-core`. 3. npm resolves the latest available package and its transitive dependencies without an audit-pinned version or lockfile. 4. A compromised or unexpectedly modified release supplies malicious installation or runtime code. 5. npm executes that code with the permissions of the user running the Agent. 6. The malicious component can access resources available to that user, including project files, browser data, environment variables, and writable user directories. ### Impact Assessment Successful exploitation could provide arbitrary code execution under the Agent user's account ...[truncated 613 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin Puppeteer to an exact, reviewed version rather than resolving the latest release: ```bash npm install --save-exact puppeteer@<reviewed-version> ``` 2. Include a reviewed `package-lock.json` and use reproducible installation: ```bash npm ci ``` 3. Verify lockfile integrity and review changes to the direct and transitive dependency graph before upgrades. 4. Run dependency installation as an unprivileged user and never recommend `sudo npm install`. 5. Consider disabling lifecycle scripts during initial verification: ```bash npm ci --ignore-scripts ``` If Puppeteer's required installation scripts must subsequently run, review and execute them in a sandboxed environment. 6. Document Puppeteer's browser-download behavior and pin or verify downloaded browser artifacts where feasible. 7. Use automated dependency auditing and controlled update tooling, but do not treat an audit command as a substitute for version pinning and provenance review. ]]>
