T08 · Insecure Dependencies
- Location
SKILL.md:559- Finding
Unpinned npm Dependencies and Registry-Resolved npx Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 559-560, 570, 592, 597, and 640-643
Vulnerability Type: Supply-chain exposure through unpinned package installation and execution
Risk Level: MediumVulnerable Code
bash npm uninstall moment npm install date-fnsbash # OR install lodash-es: npm install lodash-esbash npx bundlesizebash npx size-limitbash npm install --save-dev webpack-bundle-analyzer # Generate report npx webpack-bundle-analyzer stats.json dist/ --no-open --report report.htmlTechnical Analysis
The Skill recommends installing npm packages without exact version constraints or documented integrity controls. It also invokes
bundlesizeandsize-limitdirectly throughnpx.When an explicitly pinned local dependency is unavailable,
npxcan resolve and download a package from the configured npm registry before executing its binary. Consequently, the code executed by these instructions is not fixed at Skill review time and may change as new package releases are published.npm package installation may also execute package lifecycle scripts. A compromised package release, maintainer account, registry response, or transitive dependency could therefore introduce arbitrary code into the installation or execution process.
No package referenced by the Skill was demonstrated to be malicious. The vulnerability is the unsafe, mutable dependency execution pattern rather than evidence of an active malicious payload.
Attack Path
- An attacker compromises a referenced package, one of its transitive dependencies, its maintainer account, or the registry path used by the environment.
- The attacker publishes or serves a malicious package version.
- A developer or CI pipeline follows the Skill's instructions and runs an unversioned
npm installornpxcommand. - npm resolves the mutable package version from the r ...[truncated 920 chars]
- Remediation
View remediation
Remediation Suggestions
-
Add required tools to the project's
devDependenciesusing reviewed, exact versions rather than resolving the latest available releases at execution time:bash npm install --save-dev --save-exact bundlesize@VERSION size-limit@VERSION webpack-bundle-analyzer@VERSION -
Pin optimization dependencies such as
date-fnsandlodash-esto reviewed versions where the instructions are intended for reproducible automation. -
Commit
package-lock.jsonand use:bash npm ciin CI to enforce lockfile-resolved versions and integrity hashes.
-
Prevent
npxfrom downloading missing packages:bash npx --no-install bundlesize npx --no-install size-limit npx --no-install webpack-bundle-analyzer stats.json dist/ --no-open --report report.html -
Prefer package scripts that execute lockfile-managed local binaries:
json { "scripts": { "check:bundle": "bundlesize", "analyze:bundle": "webpack-bundle-analyzer stats.json dist/ --no-open --report report.html" } } -
Review dependency changes and lockfile diffs, enable automated vulnerability monitoring, and restrict CI secrets and workflow-token permissions according to least privilege.
-
Where compatible with the required packages, disable unnecessary lifecycle scripts during installation or explicitly review packages that require them.
-
