T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:39
- Finding
- Mutable and Unpinned npm Dependencies May Execute Unreviewed Code## Vulnerability Details **File Location**: `SKILL.md:39-56`, `SKILL.md:131`, `SKILL.md:324-325`, and `SKILL.md:558` **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: Medium **Vulnerable code snippets:** `SKILL.md:39-56`: ```bash # Initialize shadcn/ui in a Next.js project npx shadcn@latest init # Add individual components npx shadcn@latest add button npx shadcn@latest add card npx shadcn@latest add dialog npx shadcn@latest add form npx shadcn@latest add input npx shadcn@latest add select npx shadcn@latest add table npx shadcn@latest add toast npx shadcn@latest add dropdown-menu npx shadcn@latest add sheet npx shadcn@latest add tabs npx shadcn@latest add sidebar # Add multiple at once npx shadcn@latest add button card input label textarea select checkbox ``` `SKILL.md:131`: ```bash npx shadcn@latest add form input select textarea checkbox button ``` `SKILL.md:324-325`: ```bash npm install next-themes npx shadcn@latest add dropdown-menu ``` `SKILL.md:558`: ```bash npx shadcn@latest add sonner ``` ### Technical Analysis The Skill repeatedly recommends invoking `shadcn` through `npx` with the mutable `latest` distribution tag. This means the package version executed by a user or agent is selected at invocation time rather than being fixed to a version reviewed with this Skill. `npx` can download and execute npm package code immediately. npm package installation can also execute lifecycle scripts under the invoking user's account. Therefore, future changes to the resolved package, a compromised upstream release, or a package-registry account compromise could cause commands copied from this Skill to execute code that was never reviewed as part of the audited artifact. The unversioned `npm install next-themes` command similarly resolves a version dynamically unless the surrounding project imposes an effective lockfile constraint. No lockfile, integrity h ...[truncated 1784 chars]
- Remediation
- ## Remediation Suggestions 1. Replace every `npx shadcn@latest` command with an exact, reviewed version, such as `npx shadcn@X.Y.Z`, after independently verifying the selected release. 2. Pin `next-themes` and other dependencies to exact audited versions rather than relying on floating version ranges. 3. Add and commit an npm lockfile containing resolved versions and integrity metadata. 4. In automated or reproducible environments, install dependencies with `npm ci` from the committed lockfile rather than resolving new versions dynamically. 5. Prefer installing reviewed tools as project-local development dependencies and invoking the locked local binary instead of allowing `npx` to retrieve an arbitrary current release. 6. Verify package provenance, publisher identity, release signatures or attestations where available, and registry integrity before updating pinned versions. 7. Review dependency changes and generated component diffs before committing or deploying them. 8. Run package installation and code-generation commands in a restricted environment without production credentials or unnecessary filesystem access. 9. Consider disabling lifecycle scripts during dependency review where operationally feasible, then explicitly enable only required and verified installation behavior.
