T08 · Insecure Dependencies
- Location
SKILL.md:24- Finding
Execution of an Unpinned Mutable npm Package Through npx
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 24–48
Vulnerability Type:T08: Insecure Dependencies
Risk Level: MediumVulnerable code:
bash npx shadcn@latest initbash # Add a single component npx shadcn@latest add button # Add multiple components npx shadcn@latest add button card dialog # Add all available components npx shadcn@latest add --allmarkdown **Important:** The package name changed in 2024: - Old (deprecated): `npx shadcn-ui@latest add` - Current: `npx shadcn@latest add`Technical Analysis
The Skill instructs users or agents to execute
shadcn@latestdirectly throughnpx. Thelatesttag is mutable and does not identify an immutable, previously reviewed package release. Depending on the local npm configuration and cache,npxcan download the currently published package and immediately execute its CLI code with the invoking user's permissions.No lockfile, exact version, package integrity value, or independent verification step is specified for these commands. Consequently, the effective executable payload may change after the Skill itself has been reviewed. This creates a supply-chain exposure if the upstream package, publisher account, registry delivery path, or a future release is compromised. The
add --allcommand also broadens the affected dependency and generated-file surface.The audit did not find evidence that the named package is currently malicious. The risk arises from executing a mutable, unpinned third-party release.
Attack Path
- An attacker compromises the upstream package publisher, release process, or registry-hosted package version associated with the
latesttag. - The compromised release includes malicious install-time or CLI-execution code.
- A user or agent follows
SKILL.mdand runs an instructednpx shadcn@latest ...command. npxresolves and downloads the attacker-controlled re ...[truncated 924 chars]
- An attacker compromises the upstream package publisher, release process, or registry-hosted package version associated with the
- Remediation
View remediation
Remediation Suggestions
- Replace
@latestwith an exact, reviewed version, for examplenpx shadcn@X.Y.Z, after selecting and validating an appropriate release. - Prefer adding the CLI as a pinned development dependency through the project's package manager and committing the resulting lockfile.
- Use deterministic installation modes, such as
npm ci, in automated environments so dependency resolution follows the reviewed lockfile. - Verify registry provenance, package integrity, publisher identity, and release notes before updating the pinned version.
- Run the CLI with a non-privileged account in an isolated workspace or container with only the required project directory mounted.
- Review the exact files and dependency changes produced by
initoraddbefore accepting them. - Retain the documented working-directory and overwrite gates, and require explicit approval before using
--allor--overwrite. - Establish a controlled update process in which version changes are separately reviewed and tested before adoption.
- Replace
