T09 · Insecure Skill Coding Practices
- Location
SKILL.md:6- Finding
Automatic Paid Requests Use an Unrestricted EVM Private Key Without Spending Controls
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 6-9, 25-35, and 46
Vulnerability Type: Excessive secret capability and uncontrolled payment authorization
Risk Level: MediumVulnerable Code
yaml metadata: openclaw: requires: env: - EVM_PRIVATE_KEY primaryEnv: EVM_PRIVATE_KEYmarkdown 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/altcoin-season", private_key=os.environ["EVM_PRIVATE_KEY"] ) print(response.json())text ```markdown **$0.25/call** — standard priceTechnical Analysis
The skill requires direct access to an EVM private key and passes that key to the
x402_getclient. The client is explicitly expected to authorize a cryptocurrency payment automatically for each request.A private key provides transaction-signing authority rather than narrowly scoped permission to retrieve a market signal. The documented flow does not require interactive payment confirmation or specify controls for:
- Maximum payment amount per request
- Aggregate or daily spending
- Expected payment recipient
- Expected token and blockchain
- Repeated or recursive invocations
- Rejection of payment terms that differ from the advertised price
- Use of a restricted, low-balance, or delegated wallet
Consequently, a read-only data request receives substantially more authority than it needs. Although the documentation discloses the nominal price, disclosure alone does not enforce that price or limit the number of calls.
The private key is also exposed to the agent process and the imported x402 client implementation. The reviewed project contains no pinned dependency definition or local implementation that would allow the behavior of that client to be verifi ...[truncated 1638 chars]
- Remediation
View remediation
Remediation Suggestions
- Use a dedicated payment wallet with only the minimum balance required for expected calls. Never use a primary treasury or personal wallet key.
- Require explicit user approval before each paid request, displaying the recipient, chain, token, exact amount, endpoint, and cumulative session cost.
- Enforce payment policy in code, including:
- A maximum amount per call
- Per-session and daily spending limits
- An allowlisted recipient address
- Base mainnet chain-ID validation
- USDC contract-address validation
- Rejection of payment terms that differ from the displayed price
- Prevent uncontrolled repetition by adding rate limits, request deduplication, recursion limits, and a maximum number of paid calls per task.
- Replace the unrestricted private key where possible with a scoped session key, delegated authorization, smart-account policy, or payment mechanism that cannot transfer unrelated assets.
- Isolate the signing operation in a narrowly scoped wallet service or hardware-backed signer rather than exposing the raw private key to the full agent process.
- Pin and audit the x402 dependency by documenting an exact package name, version, integrity hash, and trusted source. Verify that it does not log, persist, or transmit private-key material.
- Fail closed if the endpoint redirects, the TLS identity is invalid, payment metadata is incomplete, or any payment term differs from the locally configured policy.
- Provide cost telemetry showing each authorized charge and cumulative spending, and stop execution when the configured budget is exhausted.
