T08 · Insecure Dependencies
Error
- Location
- SKILL.md:18
- Finding
- Unpinned Third-Party MCP Package Executes with Access to Wallet Credentials<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 18–35 **Vulnerability Type**: Unpinned third-party dependency with access to sensitive credentials **Risk Level**: High ### Vulnerable Code ```markdown The recommended integration is the **AgentMetal MCP server** (`@agentmetal/mcp`, v0.3.0, **13 tools**), which exposes the API as tools and handles the x402 payment signing for you. ## Add the MCP server `@agentmetal/mcp` is a stdio MCP server (binary: `agentmetal-mcp`). Add it to your MCP client config: ```jsonc { "mcpServers": { "agentmetal": { "command": "node", "args": ["packages/mcp/src/index.ts"], // or: "npx", ["-y", "@agentmetal/mcp"] "env": { "WALLET_PRIVATE_KEY": "0x…", // EVM key with USDC on Base "AGENTMETAL_MAX_USDC": "50", // per-request spend cap "AGENTMETAL_API_KEY": "am_live_…" // optional, unlocks reboot/diagnostics/exec/destroy } } } } ``` ``` ### Technical Analysis The documented alternative command, `npx -y @agentmetal/mcp`, downloads and executes the package version currently selected by the package registry. It does not pin the stated `v0.3.0` release or require verification of a package digest or integrity value. The same process is explicitly given `WALLET_PRIVATE_KEY`, an EVM private key capable of authorizing USDC transactions, as well as an optional AgentMetal account API key. Consequently, the security of these credentials depends on the integrity of every package version and transitive dependency resolved when the command runs. If the package maintainer account, registry entry, release pipeline, or a transitive dependency is compromised, a malicious release can read and transmit the environment variables immediately upon execution. The documented `AGENTMETAL_MAX_USDC` setting is only described as a per-request payment cap. It does not constrain an attacker who obtains the raw private key and uses it through a separat ...[truncated 1783 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the unversioned command with an exact, reviewed version: ```bash npx -y @agentmetal/mcp@0.3.0 ``` Do not use version ranges or registry tags such as `latest`. 2. Prefer a committed lockfile and a reproducible installation process. Verify package integrity through registry integrity hashes, signed releases, provenance attestations, or an internally reviewed artifact mirror. 3. Do not provide the raw wallet private key directly to the MCP process. Use an isolated signer, hardware-backed key, restricted signing service, or narrowly scoped wallet interface that validates destination, token, chain, amount, and cumulative spending limits. 4. Use a dedicated low-value wallet containing only the funds required for the immediate operation. Rotate the wallet if dependency compromise is suspected. 5. Enforce cumulative and time-based spending limits in addition to the documented per-request cap. Require explicit confirmation for unusually large, repeated, or unexpected transactions. 6. Store the AgentMetal API key in a secret manager and issue a narrowly scoped credential if the service supports granular permissions. Avoid exposing destructive and root-execution capabilities to a process that does not require them. 7. Run the MCP server in a sandbox with restricted filesystem, network, process, and environment access. Permit outbound connections only to expected service endpoints where practical. 8. Document a dependency review and update procedure so that newer package versions are tested and approved before the pinned version is changed. ]]>
