T08 · Insecure Dependencies
- Location
SKILL.md:34- Finding
Unpinned npm CLI Package Execution Through Mutable latest Tag
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 34-52
Vulnerability Type:T08: Insecure Dependencies
Risk Level: MediumThe installation instructions repeatedly use
npx shadcn@latest, causing users to download and execute whichever package version the npm registry resolves under the mutablelatesttag.Vulnerable Code:
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 checkboxTechnical Analysis
The
latestnpm distribution tag is mutable and does not identify an immutable, previously reviewed release. Depending on the local npm configuration,npxcan retrieve the selected package version from a configured registry and execute its CLI code immediately. The instructions provide no exact version, lockfile enforcement, integrity value, provenance check, or package-source verification.Consequently, the code that eventually runs can differ from the code available when this Skill was audited. Exploitation requires compromise of the legitimate package or publishing account, manipulation of the configured package registry, or another supply-chain event that causes
shadcn@latestto resolve to a malicious release. This finding does not establish that the currentshadcnpackage is malicious.Attack Path
- An attacker compromises the package publisher, registry delivery path, or registry configured in the victim's npm environment.
- The attacker causes the mutable
latesttag ...[truncated 1017 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the mutable tag with an exact, reviewed version, for example
npx shadcn@<approved-exact-version>. - Record the approved version in project configuration and commit the relevant lockfile so dependency resolution is reproducible.
- Configure npm to use an explicitly trusted registry and verify the package name, publisher, signatures, provenance attestations, and release integrity before execution.
- Prefer installing the reviewed CLI as a pinned development dependency and invoking the locked local binary rather than downloading an arbitrary current release during every use.
- In CI, enforce lockfile-only installation, restrict lifecycle scripts where feasible, use short-lived credentials, and run package tooling in a sandbox with least-privilege filesystem and network access.
- Establish a controlled dependency-update process that reviews and tests newer releases before changing the pinned version.
- Replace the mutable tag with an exact, reviewed version, for example
