Back to skill

Security audit

demandex

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly transparent about its paid demand-intelligence API, but its MCP setup asks users to run an unpinned npm package with a spend-capable wallet private key.

Review carefully before installing. Use the free endpoints first, avoid putting a valuable or general-purpose wallet key in the MCP config, prefer a dedicated low-balance wallet, pin and verify the MCP package version, and require explicit approval before any paid tool call.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Error
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: High

Vulnerable 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-mcp without specifying an exact package version or verifying package integrity. When the package is absent from the local npm cache, npx can retrieve the currently resolved package release from the npm registry and execute it automatically. The -y option suppresses the interactive installation confirmation.

The executed package inherits the configured environment, including EVM_PRIVATE_KEY or its PRIVATE_KEY fallback. 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-mcp package 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

  1. An attacker compromises the demandex-mcp npm publishing account, the package itself, or one of its transitively executed dependencies.
  2. The attacker publishes a malicious release under the same package name.
  3. A user follows the documen ...[truncated 1453 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin demandex-mcp to a reviewed, immutable version rather than resolving the latest release:

    json
    {
      "command": "npx",
      "args": ["-y", "demandex-mcp@0.3.0"]
    }
    
  2. Prefer installing from a lockfile-controlled project using npm ci, with the package and all transitive dependencies represented in a committed lockfile.

  3. Verify package provenance, publisher identity, signatures or attestations, and integrity hashes before execution. Review each package update before changing the pinned version.

  4. 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.

  5. Apply wallet-level spending limits, monitoring, alerts, and periodic key rotation where the signing architecture permits them.

  6. 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.

  7. Prefer a constrained signing service or delegated/session key over exposing a raw private key directly to the npm process.

  8. Document the exact reviewed package version and update procedure so users do not silently execute newly published code.

  9. Remove the PRIVATE_KEY fallback where possible to prevent accidental use of an unrelated, more privileged wallet key.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (8)

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 43)May include surrounding context.

| GET | /changelog | Human-readable changelog (markdown) |

bash
curl https://api.demandex.dev/v1/categories
curl https://api.demandex.dev/v1/sample/opportunity

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 44)May include surrounding context.

| GET | /changelog | Human-readable changelog (markdown) |

bash
curl https://api.demandex.dev/v1/categories
curl https://api.demandex.dev/v1/sample/opportunity

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 68)May include surrounding context.

| GET | /changelog | Human-readable changelog (markdown) |

bash
curl https://api.demandex.dev/v1/categories
curl https://api.demandex.dev/v1/sample/opportunity

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 73)May include surrounding context.

| GET | /changelog | Human-readable changelog (markdown) |

bash
curl https://api.demandex.dev/v1/categories
curl https://api.demandex.dev/v1/sample/opportunity

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 86)May include surrounding context.

| GET | /changelog | Human-readable changelog (markdown) |

bash
curl https://api.demandex.dev/v1/categories
curl https://api.demandex.dev/v1/sample/opportunity

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 158)May include surrounding context.

| GET | /changelog | Human-readable changelog (markdown) |

bash
curl https://api.demandex.dev/v1/categories
curl https://api.demandex.dev/v1/sample/opportunity

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 68)May include surrounding context.

bash
# Cached demand verdict ($0.03)
curl -X POST https://api.demandex.dev/v1/gauge \
  -H "Content-Type: application/json" \
  -d '{"query":"sony xm5 replacement headband","category":"headphones"}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
83% confidence
Finding

This example instructs clients to send a PAYMENT-SIGNATURE/X-PAYMENT authorization header to an external service, which involves transmitting a spend-capable payment artifact. In skill contexts, this is more dangerous than ordinary API traffic because an agent may automatically attach wallet-backed credentials and incur unauthorized charges if user approval and spending controls are weak.

Content

Scanner excerpt · SKILL.md (reported line 92)May include surrounding context.

2) Sign an x402 'exact' USDC authorization for the Base accepts[] rail, then retry.

Standard @x402 V2 clients send PAYMENT-SIGNATURE; legacy clients send X-PAYMENT.

curl -s "https://api.demandex.dev/v1/opportunities/trending" -H "PAYMENT-SIGNATURE: "

→ 200 { …, "charged": true }

text