T08 · Insecure Dependencies
- Location
SKILL.md:130- Finding
Unpinned Package Execution Through a Mutable Latest Tag
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:130-136
Vulnerability Type: Supply-chain risk caused by executing an unpinned third-party package
Risk Level: WarningVulnerable Code
markdown ### shadcn/ui as Foundation Always start with shadcn/ui components. Never reinvent what shadcn already does well: ```bash # Core components to install for most projects npx shadcn@latest add button card dialog dropdown-menu input label npx shadcn@latest add navigation-menu sheet tabs tooltip badge separator npx shadcn@latest add avatar command popover scroll-area skeletontext ### Technical Analysis The Skill instructs the agent to invoke `npx` with the mutable `shadcn@latest` package specifier. Depending on the local npm configuration and cache state, `npx` may retrieve the package from a remote registry and execute its command-line code immediately. The `latest` tag does not identify an immutable, previously audited release. Its target can change after this Skill has been reviewed. Consequently, the code executed during a future Skill invocation may differ from the code available during this audit. The instruction also lacks an integrity check, provenance verification, lockfile requirement, or explicit approval step before external package execution. This is an insecure dependency practice rather than evidence that the current shadcn package is malicious. ### Attack Path 1. An attacker compromises the upstream package publisher, registry account, release pipeline, or another component controlling the package release. 2. The attacker publishes a malicious release and causes the mutable `latest` tag to resolve to it. 3. The Skill is used for a frontend task, and the agent follows its mandatory shadcn/ui setup guidance. 4. `npx shadcn@latest ...` retrieves and runs the changed package code. 5. The malicious package executes with the privileges of the user or agent process and can modify the working project or access other resources availabl ...[truncated 764 chars]- Remediation
View remediation
Remediation Suggestions
-
Replace the mutable package tag with an exact, reviewed version, for example:
bash npx --yes shadcn@X.Y.Z add button card dialog dropdown-menu input label -
Record the selected dependency and transitive dependencies in a committed lockfile.
-
Verify registry provenance, package signatures, and integrity metadata before execution where supported.
-
Require explicit user approval before downloading or executing packages that are not already installed.
-
Prefer installation through the project's package manager followed by execution from the locked local dependency:
bash npm install --save-dev --save-exact shadcn@X.Y.Z npm exec -- shadcn add button card dialog dropdown-menu input label -
Run package installation in a restricted environment with minimal filesystem access, no unnecessary secrets, and constrained network permissions.
-
Review release notes and package contents before updating the pinned version. Use automated dependency scanning, but do not allow automatic execution of unreviewed updates.
-
