T08 · Insecure Dependencies
- Location
SKILL.md:28- Finding
Unpinned Global Installation of a Third-Party npm Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 28
Vulnerability Type: Unpinned and globally installed third-party dependency
Risk Level: MediumVulnerable Code
markdown Run via Node (from the project or after `npm install -g materials-cli`):Technical Analysis
The documentation directs users to install
materials-cliglobally without specifying an exact package version or integrity hash. Consequently, npm resolves the mutable package version currently published under that name. The audited project contains no implementation source, package manifest, lockfile, integrity metadata, or publisher verification that would allow the downloaded code to be compared with a reviewed version.An npm package can execute code through lifecycle scripts during installation and through its CLI entry point when subsequently invoked. Global installation also exposes the package executable outside an isolated project dependency tree. This is a supply-chain risk: the instruction is not itself proof that
materials-cliis malicious, but compromise of the package, its publisher account, or its distribution channel could convert the documented installation step into arbitrary local code execution.Attack Path
- An attacker compromises the npm package, its publisher credentials, or another relevant package in its dependency chain.
- The attacker publishes a modified release containing a malicious lifecycle script or CLI implementation.
- A user follows the instruction at
SKILL.md:28without an exact version or integrity constraint. - npm resolves and downloads the attacker-controlled release.
- Malicious lifecycle code may execute during installation, or malicious CLI code executes when the user runs a documented
materialscommand. - The payload operates with the permissions of the account performing the installation or running the CLI.
Impact Assessment
Successful exploitation could allow arbitrary code execution with the ...[truncated 642 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the dependency to an exact, reviewed version rather than allowing npm to resolve the latest mutable release.
- Provide a lockfile and verify package integrity through npm integrity metadata or an equivalent cryptographic digest.
- Document the canonical package registry, package owner, and trusted publisher so users can verify provenance.
- Prefer a project-local dependency over a global installation to reduce scope and improve reproducibility.
- Where compatible with package functionality, install with lifecycle scripts disabled and execute only after reviewing the package contents.
- Include the auditable CLI implementation in the project or link to immutable, versioned source corresponding exactly to the distributed package.
- Avoid elevated installation privileges and run the CLI under a least-privileged account with access only to required files and secrets.
