T08 · Insecure Dependencies
- Location
SKILL.md:35- Finding
Unpinned Globally Installed Package Receives a Wallet Private Key
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 35; security-sensitive environment configuration is documented at lines 39–54
Vulnerability Type: Unpinned third-party dependency with access to cryptographic credentials
Risk Level: HighVulnerable Code
bash npm install -g drain-mcpThe installed package is subsequently configured with a wallet private key:
json { "mcpServers": { "drain": { "command": "drain-mcp", "env": { "DRAIN_PRIVATE_KEY": "0x_your_polygon_wallet_private_key" } } } }Technical Analysis
The installation command retrieves the current registry version of
drain-mcpwithout pinning an exact version or verifying package integrity. Installing it globally also makes the package executable broadly within the user's environment rather than confining it to a project-local dependency boundary.This package is particularly security-sensitive because it is launched with
DRAIN_PRIVATE_KEY. According to the Skill documentation, the package loads this key into memory and uses it to sign EIP-712 payment vouchers and Polygon transactions. Although the documentation states that the raw key is not transmitted, the reviewed project contains onlySKILL.md; it does not contain the npm package implementation needed to independently enforce or verify that claim.Consequently, registry compromise, maintainer-account compromise, or a malicious future package release could change the effective executable behavior after this Skill has been audited. The risk does not depend on the legitimate current version being malicious: the mutable installation instruction makes later package versions part of the trust boundary.
Attack Path
- An attacker compromises the npm package, its publisher account, or the package distribution process.
- The attacker publishes a modified release under the same
drain-mcppackage name. - A ...[truncated 1218 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin
drain-mcpto an exact, independently audited version rather than installing the mutable latest release. - Publish and verify a cryptographic integrity digest or signed provenance for the approved package artifact.
- Use a project-local installation with a committed lockfile instead of a global installation.
- Review the actual package source corresponding exactly to the pinned artifact and verify that builds are reproducible.
- Run the MCP process under a dedicated, unprivileged operating-system account or sandbox with restricted filesystem and network access.
- Pass only the minimum required environment variables to the process.
- Continue using a dedicated low-value wallet, but enforce wallet balance and allowance limits rather than relying solely on documentation.
- Revoke token allowances and rotate the wallet key immediately if package integrity is ever uncertain.
- Pin
