T09 · Insecure Skill Coding Practices
- Location
SKILL.md:30- Finding
Unbounded Automatic Payments Using a Raw Wallet Private Key
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 6–9, 30–40, and 46–53
Vulnerability Type: Automatic financial authorization with a highly sensitive wallet credential
Risk Level: MediumComplete Code Snippets
yaml requires: env: - EVM_PRIVATE_KEY primaryEnv: EVM_PRIVATE_KEYtext The x402 client handles payment authorisation automatically. No API key, no account, no subscription required — just an EVM wallet with USDC on Base mainnet.python # Example using the x402-python client from x402.client import x402_get response = x402_get( url="https://apexrunner.ai/signals/fg-micro", private_key=os.environ["EVM_PRIVATE_KEY"] ) print(response.json())text **$0.01/call** — standard price Early adopters automatically receive 30% off ($0.01/call) until 2026-09-21. Discount tiers apply automatically based on wallet call history: - Early Adopter (0–9 calls): 30% off - Engaged (10–49 calls): 15% off - Loyal (50–199 calls): 15% permanent - VIP (200+ calls): 20% permanentTechnical Analysis
The Skill requires direct access to
EVM_PRIVATE_KEYand passes that secret to an x402 client that automatically authorizes paid requests. The documented use case explicitly includes high-frequency polling, but the Skill defines no per-request confirmation, maximum call count, session budget, daily spending limit, rate limit, or wallet-balance restriction.A private key represents the full authority granted to its wallet. Supplying it directly to an agent-accessible dependency increases the consequences of accidental disclosure, dependency compromise, or uncontrolled invocation. Although the reviewed file contains no evidence that the key is deliberately exfiltrated, the architecture unnecessarily places a high-value credential in the execution path of an externally billed request.
The remote service and payment protocol determine whether each ...[truncated 1605 chars]
- Remediation
View remediation
Remediation Suggestions
- Use a dedicated, low-balance wallet created exclusively for this Skill; never use a primary or treasury wallet.
- Replace direct private-key access with a scoped signing service or policy-controlled wallet that can restrict the recipient, network, token, transaction type, and maximum amount.
- Enforce local per-call, per-session, and daily spending limits before invoking the x402 client.
- Add strict polling rate limits, maximum retry counts, exponential backoff, and circuit breakers.
- Require explicit user confirmation when a payment exceeds the expected price or when cumulative spending crosses a configured threshold.
- Validate the chain ID, payment recipient, asset contract, and exact maximum charge before signing.
- Pin the x402 dependency to a reviewed version, verify package provenance and integrity, and audit updates before deployment.
- Prevent secrets from appearing in logs, exceptions, telemetry, prompts, or diagnostic output.
- Revoke and rotate the wallet credential immediately if exposure is suspected.
