T08 · Insecure Dependencies
Error
- Location
- SKILL.md:33
- Finding
- Unpinned npm and npx Commands Execute Mutable Third-Party Code<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:33-38, 264-267, 277-288`; `references/react-integration.md:10-12, 600-601, 674-675, 687-688` **Vulnerability Type**: Supply-chain exposure through unpinned executable dependencies **Risk Level**: High ### Vulnerable Code ```bash # Create new project with framework of choice npm create wxt@latest # Or with specific template npm create wxt@latest -- --template react-ts npm create wxt@latest -- --template vue-ts npm create wxt@latest -- --template svelte-ts ``` ```bash npm create wxt@latest -- --template react-ts npm install -D tailwindcss postcss autoprefixer npx tailwindcss init -p npx shadcn@latest init ``` Additional occurrences include: ```bash npx shadcn@latest init npx shadcn@latest add button card dialog ``` ### Technical Analysis The Skill directs users or an agent to execute packages resolved dynamically from the npm registry. In particular, the `@latest` tag is mutable and does not identify the package version that was reviewed when the Skill was published. Both `npm create` and `npx` can download and execute package code. Package lifecycle scripts and CLI initialization logic run with the privileges of the invoking user. Consequently, the effective code executed by these instructions can change without any modification to this repository. The unversioned `npm install` commands also leave dependency resolution dependent on the package metadata and lockfile generated at execution time. The repository does not supply a reviewed lockfile or integrity metadata because it is a documentation Skill rather than a complete application. ### Attack Path 1. An attacker compromises a referenced npm package, one of its transitive dependencies, its maintainer account, or the associated registry release process. 2. The attacker publishes a malicious version and causes it to be selected by the `latest` tag or an unconstrained dependency range. 3. A user or coding agent follows the Skill and runs ...[truncated 950 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace `@latest` with exact, reviewed package versions, for example: ```bash npm create wxt@X.Y.Z npx --yes shadcn@X.Y.Z init ``` 2. Document the expected package publisher, repository, version, and integrity information. 3. Generate and commit a lockfile for any maintained template or example project. 4. Use `npm ci` for reproducible installation after reviewing the lockfile. 5. Review package lifecycle scripts before installation and consider initially installing with `--ignore-scripts` where compatible. 6. Run project generators in a restricted development container or sandbox without production credentials. 7. Use automated dependency scanning and require manual review before updating pinned versions. ]]>
