T08 · Insecure Dependencies
- Location
SKILL.md:9- Finding
Unpinned npm Packages May Execute Untrusted Third-Party Code
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 9, 19, 26-38, and 68
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: MediumVulnerable Code
bash # Line 9 npx http-server ./dist -p 8080 -c-1 # Line 19 npm run build && npx serve dist # Lines 26-38 npx vercel link npx vercel npx vercel --prod npx vercel env add SECRET_KEY # Line 68 npm install -D gh-pagesTechnical Analysis
The documented commands execute or install npm packages without pinning them to reviewed versions. If an
npxpackage is not already available locally, npm may download the currently resolved package version from the configured registry and execute it. Thegh-pagesinstallation similarly resolves a mutable version because no exact version is specified.Consequently, the code ultimately executed can differ from the version reviewed when this skill was audited. A compromised package release, transitive dependency, npm account, registry mirror, or package-resolution configuration could introduce arbitrary code. npm lifecycle scripts may also execute during package installation.
The ordinary behavior of the named packages is consistent with the skill's declared deployment purpose, and the audited file contains no evidence that those packages are currently malicious. The risk arises from mutable, unverified dependency resolution.
Attack Path
- An attacker compromises a referenced npm package, one of its transitive dependencies, its publisher account, or the registry used by the victim.
- The attacker publishes or serves a malicious version that contains an installation lifecycle script or malicious executable behavior.
- A user or agent follows
SKILL.mdand invokes an unpinnednpxornpm installcommand. - npm resolves and downloads the attacker-controlled version.
- The malicious code executes with the permissions of the invoking user.
- The ...[truncated 915 chars]
- Remediation
View remediation
Remediation Suggestions
-
Pin every directly invoked package to an exact, reviewed version, for example:
bash npx --yes http-server@<reviewed-exact-version> ./dist -p 8080 -c-1 npx --yes serve@<reviewed-exact-version> dist npx --yes vercel@<reviewed-exact-version> --prod npm install --save-dev --save-exact gh-pages@<reviewed-exact-version> -
Prefer declaring tools in
devDependencies, committing the generated lockfile, and invoking local binaries through reviewed package scripts. -
Use
npm cirather than mutable dependency installation in CI and deployment automation so dependency versions and integrity hashes are enforced by the lockfile. -
Review direct and transitive dependencies before approving upgrades. Use automated dependency scanning while retaining manual review for deployment tooling.
-
Configure npm to use a trusted registry and verify that project-level or user-level npm configuration cannot redirect package resolution to an untrusted source.
-
Run preview and deployment tools with a least-privileged account. Expose only the credentials required for the specific deployment and avoid making unrelated secrets available to the process.
-
Where supported, verify package provenance, signatures, and published integrity metadata before use.
-
