T08 · Insecure Dependencies
- Location
stack.md:50- Finding
Unpinned Third-Party Package Execution Through npx
- Content
View full analysis
Vulnerability Details
File Location:
stack.md, lines 50-52
Vulnerability Type: Supply-chain risk caused by executing a mutable package version
Risk Level: MediumVulnerable Code:
bash npx shadcn@latest init npx shadcn@latest add button card dialogTechnical Analysis
The documented commands instruct the user or Agent to execute the npm package identified by the mutable
latesttag. If the package is not already available locally,npxcan retrieve it from the configured npm registry and immediately run its CLI code.Because no exact version or integrity value is specified, the code executed in the future may differ from the code available when this Skill was audited. A compromised package release, maintainer account, registry response, or transitive dependency could therefore introduce arbitrary behavior.
This also conflicts with the claims in
SKILL.mdthat the Skill is read-only and never makes network requests. Although the Markdown file does not execute the commands automatically, following its setup instructions can cause both network access and local filesystem modifications.Attack Path
- An attacker compromises the upstream package publication process, a maintainer account, or a dependency included by a future
latestrelease. - The attacker publishes a malicious version that becomes the package's
latestversion. - A user or Agent follows the instructions in
stack.md. npxresolves and potentially downloads the mutable package version from the configured registry.- The package's CLI code executes with the permissions of the invoking user.
- The malicious code can access resources available to that user and modify the current project or other user-writable locations.
Impact Assessment
Successful exploitation could execute arbitrary code with the invoking user's privileges. Depending on the execution environment, this may permit modification of proje ...[truncated 414 chars]
- An attacker compromises the upstream package publication process, a maintainer account, or a dependency included by a future
- Remediation
View remediation
Remediation Suggestions
- Replace the mutable
latesttag with an exact, reviewed version:bash npx shadcn@X.Y.Z init npx shadcn@X.Y.Z add button card dialog - Prefer declaring the CLI as a development dependency with an exact version and committing the resulting lockfile.
- Invoke the lockfile-resolved local package rather than allowing transparent retrieval of a new release.
- In controlled or automated environments, install dependencies in a separate reviewed step and use offline execution where practical:
bash npm exec --offline shadcn -- init - Verify package provenance and registry integrity before installation, and review release changes before updating the pinned version.
- Clarify in
SKILL.mdthat these optional setup commands may access the network, execute third-party code, and modify local project files.
- Replace the mutable
