T09 · Insecure Skill Coding Practices
- Location
SKILL.md:4- Finding
Unattended Cryptocurrency Payment Authorization Using a Reusable Wallet Private Key
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 4-9 and 27-35
Vulnerability Type:T09: Insecure Skill Coding Practices
Risk Level: MediumVulnerable Code
yaml metadata: openclaw: requires: env: - EVM_PRIVATE_KEY primaryEnv: EVM_PRIVATE_KEYpython # Example using the x402-python client from x402.client import x402_get response = x402_get( url="https://apexrunner.ai/signals/market-tick", private_key=os.environ["EVM_PRIVATE_KEY"] ) print(response.json())The accompanying instructions state:
The x402 client handles payment authorisation automatically.
Technical Analysis
The Skill requires the agent process to access a reusable EVM private key and passes that key directly to a third-party x402 client. Each request can automatically authorize a USDC payment to an external service.
No explicit user confirmation, per-request spending ceiling, cumulative budget, request-rate limit, recipient allowlist, or payment-challenge validation requirement is documented. Consequently, unintended repeated invocation, agent automation errors, or a compromised external payment endpoint could cause the wallet to authorize more payments than the user intended.
The code does not hardcode or deliberately transmit the private key to the signal endpoint, so direct theft by
apexrunner.aiis not established. Nevertheless, exposing the key to the agent runtime and third-party client library increases the secret's attack surface. The immediate confirmed risk is unattended financial authorization; private-key compromise would additionally become possible if the imported client package or runtime were compromised.Attack Path
- The operator configures
EVM_PRIVATE_KEYin the agent environment and funds the associated wallet with USDC on Base. - The agent loads this Skill and invokes
x402_getagainst the external signal endpoint. - Th ...[truncated 1067 chars]
- The operator configures
- Remediation
View remediation
Remediation Suggestions
- Use a dedicated, low-balance wallet exclusively for this Skill rather than a general-purpose wallet.
- Replace direct private-key access with a scoped signer or policy-controlled signing service that does not expose raw key material to the agent.
- Require explicit user confirmation before every paid request, displaying the recipient, network, token, and exact amount.
- Enforce a maximum amount per transaction, a cumulative daily budget, and request-rate limits outside the agent's control.
- Validate that every payment uses Base mainnet, USDC, the expected recipient, and the advertised maximum price before signing.
- Reject payment challenges whose amount or destination differs from a locally pinned policy.
- Pin the x402 client to a reviewed version, verify package integrity, and audit dependency updates before deployment.
- Prevent the private key from appearing in logs, exceptions, telemetry, prompts, or subprocess environments.
- Add loop prevention and idempotency controls so retries cannot silently create duplicate payments.
- Document revocation, wallet rotation, monitoring, and emergency fund-transfer procedures.
