T08 · Insecure Dependencies
- Location
SKILL.md:15- Finding
Unpinned npm Packages Allow Supply-Chain Code Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 15-19
Vulnerability Type: Unpinned third-party package installation and execution
Risk Level: HighVulnerable Code
bash # MCP server (preferred — works with Claude Code, Cursor, Windsurf, VS Code) # https://www.npmjs.com/package/@zkgov/mcp claude mcp add zkgov npx @zkgov/mcp # Standalone CLI # https://www.npmjs.com/package/@zkgov/cli npm install -g @zkgov/cli zkgov --helpTechnical Analysis
The installation instructions execute
@zkgov/mcpthroughnpxand install@zkgov/cliglobally without specifying exact package versions or verifying package integrity. Consequently, the code installed or executed depends on whichever package release the npm registry resolves at the time of use, rather than a version reviewed with this skill.npx @zkgov/mcpcan download and execute the current registry version. Similarly,npm install -g @zkgov/cliinstalls a mutable latest release and may run npm lifecycle scripts during installation. If the publisher account, npm package, registry resolution, or a transitive dependency is compromised, a malicious release can execute code under the privileges of the user running the agent.Registering the unpinned MCP command also creates an ongoing trust relationship: subsequent invocations may resolve a newer, unreviewed package version. The referenced npm web pages are informational links and provide no cryptographic integrity enforcement.
Attack Path
- An attacker compromises the npm publisher account, an upstream dependency, or another part of the package publication pipeline.
- The attacker publishes a malicious version of
@zkgov/mcp,@zkgov/cli, or a dependency resolved by either package. - A user or agent follows the documented installation instructions without an explicit version or integrity lock.
npxretrieves and runs the malicious MCP package, or npm installs the malicio ...[truncated 1311 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin both packages to explicitly reviewed, immutable versions, for example:
bash claude mcp add zkgov npx --yes @zkgov/mcp@<reviewed-version> npm install -g @zkgov/cli@<reviewed-version> - Prefer a checked-in lockfile and local project installation over global installation. Use
npm ciso dependency versions must match the lockfile. - Verify package provenance, signatures where supported, publisher identity, and expected integrity hashes before execution.
- Review direct and transitive dependencies, including npm lifecycle scripts, before approving package upgrades.
- Disable lifecycle scripts during installation where compatible, such as with
npm install --ignore-scripts, and execute only reviewed entry points. - Do not run npm,
npx, the CLI, or the MCP server with administrator or root privileges. - Run the MCP server in a sandbox with restricted filesystem, environment-variable, credential, and network access.
- Do not expose wallet private keys to the MCP or CLI process unless strictly required. Use a dedicated low-value testnet wallet and narrowly scoped secret injection.
- Establish an explicit update process in which new package versions are reviewed, tested, and pinned before deployment rather than automatically consuming the latest release.
- Pin both packages to explicitly reviewed, immutable versions, for example:
