T08 · Insecure Dependencies
- Location
SKILL.md:222- Finding
Unpinned npx Commands May Download and Execute Unreviewed Packages
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 222-239
Vulnerability Type: Insecure third-party package execution
Risk Level: MediumVulnerable Code:
makefile build: node_modules ## Build TypeScript npx tsc test: node_modules ## Run tests npx vitest run test-watch: node_modules ## Run tests in watch mode npx vitest lint: node_modules ## Lint code npx eslint src/ --ext .ts,.tsx npx tsc --noEmit fmt: node_modules ## Format code npx prettier --write 'src/**/*.{ts,tsx}' dev: node_modules ## Run in development mode npx tsx watch src/index.tsTechnical Analysis
The documented Makefile recipes invoke several tools through
npxwithout--no-install, explicit package versions, or a prerequisite that verifies each executable is installed locally. When a requested executable cannot be found in the project's local dependencies,npxmay resolve and download a package from the configured npm registry before executing it.This behavior creates a supply-chain execution path in which the effective code may not be limited to dependencies already reviewed and pinned by the project's lockfile. Registry compromise, malicious registry configuration, package compromise, dependency confusion, or an incorrectly resolved package could cause unintended third-party code to execute during routine build, test, lint, formatting, or development operations.
Attack Path
- An Agent copies the documented Node.js Makefile template into a project.
- A required local executable, such as
vitest,eslint,prettier,tsx, ortsc, is absent fromnode_modules/.bin. - A developer or automation service runs the corresponding Make target.
npxattempts to resolve the missing executable through the configured npm registry.- A compromised, malicious, or unexpectedly resolved package is downloaded.
- The package executable, and potentially applicable package installatio ...[truncated 735 chars]
- Remediation
View remediation
Remediation Suggestions
- Declare all required tools in
devDependenciesusing reviewed versions. - Commit and review the generated dependency lockfile.
- Use
npm ciin reproducible build and CI environments rather than permitting ad hoc dependency resolution. - Replace the commands with package scripts or direct local executable paths such as
./node_modules/.bin/vitest. - If
npxmust be retained, usenpx --no-install <tool>so execution fails when the tool is not already installed locally. - Add explicit checks that all expected executables exist under
node_modules/.binbefore running build targets. - Configure trusted npm registries explicitly and enforce dependency integrity and package provenance controls in CI.
- Declare all required tools in
