T09 · Insecure Skill Coding Practices
- Location
SKILL.md:18- Finding
Paid x402 requests can spend wallet funds without explicit per-request confirmation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:18-23, 39-44, 52-53, 73-74, 89-90, 140-146
Vulnerability Type: Unconfirmed paid operation
Risk Level: MediumVulnerable Instructions
markdown Call `GET /health` first (free) before paying for history endpoints. Use `npx agentcash@latest fetch` for the paid routes.markdown | Task | Endpoint | Price | Returns | |------|----------|-------|---------| | Current gas | `GET /gas` | $0.002 | Base fee, low/med/high priority tiers, cost estimate in ETH and USD | | Compare chains | `GET /gas/compare` | $0.01 | Base, OP, Arbitrum, Ethereum ranked cheapest first, cost in USD | | Historical trend | `GET /gas/history` | $0.01 | Time series, min/max/avg/median, cheap-or-expensive verdict | | Cheapest hours | `GET /gas/cheapest-window` | $0.02 | Hours to avoid, cheapest hour, savings vs the average hour and in USD | | Data coverage | `GET /health` | **free** | How much history has been collected so far |bash npx agentcash@latest fetch https://base-gas-x402-production.up.railway.app/gasbash npx agentcash@latest fetch https://base-gas-x402-production.up.railway.app/gas/comparebash npx agentcash@latest fetch "https://base-gas-x402-production.up.railway.app/gas/history?hours=24"markdown ### Decide whether to transact now - [ ] Check the trend and verdict: `GET /gas/history?hours=24` - [ ] If `verdict` is `flat`, proceed and tell the user there is nothing to wait for - [ ] If `cheap`, proceed - [ ] If `expensive`, check whether waiting actually helps: `GET /gas/cheapest-window` ```bash npx agentcash@latest fetch "https://base-gas-x402-production.up.railway.app/gas/history?hours=24"text ### Technical Analysis The Skill maps ordinary informational requests—such as checking current gas prices, comparing chains, or deciding whether to wait—to x402-protected endpoints. It directs the Agent to invoke `npx agentcash@latest fetch`, which can settle a payment from the ...[truncated 2229 chars]- Remediation
View remediation
Remediation Suggestions
- Require explicit user confirmation immediately before every paid endpoint request.
- Present the endpoint, network, recipient service, currency, exact advertised price, and maximum possible charge in the confirmation prompt.
- Use a CLI-enforced payment ceiling such as an explicit
--max-paymentoption if supported, rather than relying only on natural-language instructions. - Treat general requests for gas information as authorization to retrieve information, not as implicit authorization to spend funds.
- Keep
/healthas the default first request, but clearly distinguish its coverage check from payment approval. - For multi-step workflows, obtain fresh approval before each additional paid endpoint unless the user has explicitly approved a bounded total budget.
- Prefer a read-only or free data source when the user has not approved payment.
