T08 · Insecure Dependencies
- Location
SKILL.md:24- Finding
Unpinned Third-Party Package Is Downloaded and Executed
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:24-40
Vulnerability Type: Unpinned npm dependency installation and execution
Risk Level: HighVulnerable Code:
bash npm install -g onchor onchor init my-agent # register + get wallet + oat_ token onchor browse # discover APIs onchor browse --slug token-scanner # details + plans onchor subscribe token-scanner --plan free # subscribe onchor call token-scanner /scan --token TOKEN_MINT # call onchor balance # check USDC balancejson { "mcpServers": { "onchor": { "command": "npx", "args": ["onchor", "mcp"] } } }Technical Analysis
The Skill instructs users to globally install
onchorwithout an exact version or integrity constraint. It also configuresnpxto execute the package without pinning a reviewed release. Both commands resolve package content at execution time, so the code that runs can differ from the code available when the Skill was audited.A global npm installation may execute package lifecycle scripts with the permissions of the invoking user. Likewise,
npxcan download and immediately run a package that is not already installed. The project provides no lockfile, integrity hash, provenance verification, source review instructions, or restriction on npm lifecycle scripts.This is a supply-chain weakness rather than evidence that the current
onchorpackage is malicious. Exploitation depends on a malicious publication, registry compromise, maintainer compromise, or package-resolution attack.Attack Path
- An attacker compromises the package publisher or registry account, or causes an unsafe package version to be resolved.
- The attacker publishes a modified
onchorrelease containing a malicious lifecycle script, CLI implementation, or MCP server. - An agent follows the Skill and runs
npm install -g onchoror starts the unpinned package throughnpx. - npm ret ...[truncated 1221 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the package to a specific, reviewed version, such as
onchor@2.0.0, rather than resolving the latest release. - Publish and verify the package integrity hash and package provenance before execution.
- Use a project-local dependency and committed lockfile instead of a global installation.
- Configure MCP to invoke an already installed, verified binary rather than allowing
npxto download code implicitly. - Use
npx --no-installwhere appropriate so startup fails if the reviewed package is unavailable locally. - Disable npm lifecycle scripts during installation when they are unnecessary, then review any required scripts separately.
- Run the CLI and MCP server in a sandbox with minimal filesystem, network, environment-variable, and wallet access.
- Document the official npm package scope, publisher identity, source repository, signing or provenance process, and supported integrity values.
- Require explicit review before dependency upgrades rather than automatically trusting future releases.
- Pin the package to a specific, reviewed version, such as
