T08 · Insecure Dependencies
- Location
SKILL.md:100- Finding
Unpinned npm Package Executes with Access to a Funded Wallet Private Key
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 100-114
Vulnerability Type: Unpinned third-party dependency with sensitive credential access
Risk Level: HighVulnerable Code
json { "mcpServers": { "demandex": { "command": "npx", "args": ["-y", "demandex-mcp"], "env": { "EVM_PRIVATE_KEY": "0x…", "DEMANDEX_API_URL": "https://api.demandex.dev" } } } }text `EVM_PRIVATE_KEY` (falls back to `PRIVATE_KEY`) funds the paid tools with USDC on Base.Technical Analysis
The documented configuration invokes
npx -y demandex-mcpwithout specifying an exact package version or verifying package integrity. When the package is absent from the local npm cache,npxcan retrieve the currently resolved package release from the npm registry and execute it automatically. The-yoption suppresses the interactive installation confirmation.The executed package inherits the configured environment, including
EVM_PRIVATE_KEYor itsPRIVATE_KEYfallback. Consequently, any code executed through the package has direct access to a private key intended to control a USDC-funded wallet. A compromised maintainer account, malicious package release, registry compromise, or dependency-chain compromise could therefore turn the documented startup command into arbitrary remote code execution with wallet-key access.The audit did not establish that the current
demandex-mcppackage is malicious. The vulnerability is the unsafe trust and execution model: a mutable, unpinned dependency is automatically downloaded and executed while a high-value secret is present in its environment.Attack Path
- An attacker compromises the
demandex-mcpnpm publishing account, the package itself, or one of its transitively executed dependencies. - The attacker publishes a malicious release under the same package name.
- A user follows the documen ...[truncated 1453 chars]
- An attacker compromises the
- Remediation
View remediation
Remediation Suggestions
-
Pin
demandex-mcpto a reviewed, immutable version rather than resolving the latest release:json { "command": "npx", "args": ["-y", "demandex-mcp@0.3.0"] } -
Prefer installing from a lockfile-controlled project using
npm ci, with the package and all transitive dependencies represented in a committed lockfile. -
Verify package provenance, publisher identity, signatures or attestations, and integrity hashes before execution. Review each package update before changing the pinned version.
-
Do not provide a general-purpose or high-value wallet private key. Create a dedicated signer containing only the minimum USDC balance required for expected calls.
-
Apply wallet-level spending limits, monitoring, alerts, and periodic key rotation where the signing architecture permits them.
-
Run the MCP package in an isolated container or sandbox with a read-only filesystem, restricted outbound networking, no access to unrelated user files, and no unnecessary environment variables.
-
Prefer a constrained signing service or delegated/session key over exposing a raw private key directly to the npm process.
-
Document the exact reviewed package version and update procedure so users do not silently execute newly published code.
-
Remove the
PRIVATE_KEYfallback where possible to prevent accidental use of an unrelated, more privileged wallet key.
-
