T09 · Insecure Skill Coding Practices
- Location
SKILL.md:7- Finding
Automatic Paid Requests Use a Raw EVM Private Key Without Explicit Spending Controls
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 7–8, 23–34, and 49
Vulnerability Type: Sensitive wallet credential exposure and uncontrolled payment authorization
Risk Level: MediumVulnerable Code
yaml requires: env: - EVM_PRIVATE_KEYmarkdown The agent makes an x402-authenticated GET request to: `https://apexrunner.ai/signals/mean-reversion-scan` 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/mean-reversion-scan", private_key=os.environ["EVM_PRIVATE_KEY"] ) print(response.json())text ```markdown **$0.75/call** — standard priceTechnical Analysis
The Skill requires access to an EVM wallet private key and passes that credential directly to an x402 client that automatically authorizes paid requests. A private key grants signing authority over its associated wallet and is substantially more sensitive than a narrowly scoped API token.
Although the per-call price is disclosed, the Skill does not document or enforce:
- Explicit user approval before each payment.
- A maximum payment amount per request.
- A cumulative session or daily spending limit.
- Validation of the payment recipient, chain, token, and authorization amount before signing.
- Use of a dedicated, low-balance wallet.
- A pinned and audited version of the x402 client.
- Controls preventing the private key from being logged or exposed to unrelated process components.
The reviewed file does not prove that
apexrunner.aireceives the private key, and no private-key exfiltration by the endpoint is asserted. The risk arises from exposing full wallet signing authority to the local client process and allowing that clie ...[truncated 1488 chars]- Remediation
View remediation
Remediation Suggestions
- Replace direct use of a general-purpose wallet private key with a dedicated payment wallet containing only the minimum required balance.
- Prefer a scoped signer, delegated authorization mechanism, or isolated signing service that cannot perform arbitrary wallet transactions.
- Require explicit user confirmation before every payment, displaying the recipient, network, token, amount, and endpoint.
- Enforce strict per-request, per-session, and daily spending limits independently of values supplied by the remote service.
- Validate that every authorization targets the expected Base mainnet chain, approved USDC contract, intended recipient, and maximum advertised amount.
- Prevent automatic retries from creating additional payments unless the user approves them.
- Pin the x402 dependency to a specific reviewed version and verify package integrity through hashes or lockfiles.
- Ensure the private key is never logged, serialized, included in error reports, or exposed to unrelated plugins and subprocesses.
- Document wallet rotation and revocation procedures in case the execution environment or dependency is compromised.
- Add clear warnings that repeated Skill invocation incurs charges and expose the accumulated cost to the user before further calls.
