T08 · Insecure Dependencies
- Location
references/validate-strategies.md:9- Finding
Unpinned npx Commands May Download and Execute Untrusted Packages
- Content
View full analysis
Vulnerability Details
File Location:
references/validate-strategies.md:9-10, 28, 54
Vulnerability Type: Supply-chain exposure through unpinned dependency execution
Risk Level: MediumVulnerable Code:
markdown | JavaScript/JSX | `npx eslint <file>` | Single-file lint | | TypeScript/TSX | `npx eslint <file>` | Prefer linting without type checking |markdown | JavaScript/TS | `npx jest <test-file> --no-coverage` | Single test file |bash timeout 10 npx eslint src/file.ts 2>&1Technical Analysis
The validation instructions execute
eslintandjestthroughnpxwithout requiring an exact package version, a verified lockfile, a preinstalled local binary, or an option that prohibits package installation.Depending on the npm version and configuration, when the requested executable is unavailable locally,
npxmay resolve and download a package from the configured registry before executing it. This converts a local validation step into a supply-chain execution path whose effective code may change after the Skill has been reviewed.Package executable code and installation lifecycle scripts run with the same operating-system privileges as the Agent. A compromised package release, malicious registry configuration, dependency-confusion condition, or package-resolution mistake could therefore result in arbitrary local command execution.
Attack Path
- The Skill is activated for a JavaScript or TypeScript editing task.
- The mandatory verification stage selects
npx eslintornpx jest. - The corresponding package executable is not installed in the project.
npxresolves the package through the configured package registry.- A compromised, substituted, or otherwise untrusted package is downloaded.
- Package installation hooks or the resolved executable run with the Agent's user privileges.
- The malicious code can access file ...[truncated 795 chars]
- Remediation
View remediation
Remediation Suggestions
- Require
eslintandjestto be declared in the project's development dependencies with versions governed by a committed lockfile. - Prohibit automatic package installation during verification:
bash timeout 10 npx --no-install eslint src/file.ts 2>&1 timeout 30 npx --no-install jest tests/file.test.ts --no-coverage 2>&1 - Prefer explicit local binaries where supported:
bash timeout 10 ./node_modules/.bin/eslint src/file.ts 2>&1 - Fail safely when the required local executable is absent rather than retrieving it automatically.
- Require explicit user authorization before installing any missing dependency.
- Validate lockfile integrity and use a trusted, explicitly configured package registry.
- In higher-assurance environments, run dependency-backed validation in a sandbox with restricted filesystem, credential, and network access.
- Require
