T09 · Insecure Skill Coding Practices
- Location
SKILL.md:417- Finding
Automatic x402 Payments Lack Documented Approval and Spending Controls
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This doc-only wallet skill is not plainly malicious, but it gives agents broad real-money authority including transfers, trading, Amazon checkout, and automatic paid fetches without enough user-control guidance.
Review this carefully before installing. Only use it with low-balance or tightly scoped API keys, prefer testnet, restrict credential-file permissions, avoid broad SPONGE_API_KEY exports, and require explicit human confirmation before any transfer, trade, bridge, withdrawal, non-dry-run checkout, or x402 paid fetch. Treat x402 URLs and Amazon checkout inputs as high-risk because they can spend funds or place orders through the agent.
SKILL.md:417Automatic x402 Payments Lack Documented Approval and Spending Controls
SKILL.md:55Financial Bearer Credential Is Persisted in a Plaintext File Without Enforced Permissions
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
POST /api/polymarket -> Polymarket prediction market trading
POST /api/checkout -> Amazon checkout (initiate purchase)
GET /api/checkout/:sessionId -> checkout status
DELETE /api/checkout/:sessionId -> cancel checkout
GET /api/checkout/history -> checkout history
POST /api/checkout/amazon-search -> search Amazon products
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
GET /api/checkout/history -> checkout history POST /api/checkout/amazon-search -> search Amazon products
Rules: use register (agents), never login | store key in ~/.spongewallet/credentials.json | requests are JSON Errors: HTTP status + JSON error message
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
GET /api/checkout/history -> checkout history POST /api/checkout/amazon-search -> search Amazon products
Rules: use register (agents), never login | store key in ~/.spongewallet/credentials.json | requests are JSON Errors: HTTP status + JSON error message
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
GET /api/checkout/history -> checkout history POST /api/checkout/amazon-search -> search Amazon products
Rules: use register (agents), never login | store key in ~/.spongewallet/credentials.json | requests are JSON Errors: HTTP status + JSON error message
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
GET /api/checkout/history -> checkout history POST /api/checkout/amazon-search -> search Amazon products
Rules: use register (agents), never login | store key in ~/.spongewallet/credentials.json | requests are JSON Errors: HTTP status + JSON error message
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
GET /api/checkout/history -> checkout history POST /api/checkout/amazon-search -> search Amazon products
Rules: use register (agents), never login | store key in ~/.spongewallet/credentials.json | requests are JSON Errors: HTTP status + JSON error message
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
GET /api/checkout/history -> checkout history POST /api/checkout/amazon-search -> search Amazon products
Rules: use register (agents), never login | store key in ~/.spongewallet/credentials.json | requests are JSON Errors: HTTP status + JSON error message
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
GET /api/checkout/history -> checkout history POST /api/checkout/amazon-search -> search Amazon products
Rules: use register (agents), never login | store key in ~/.spongewallet/credentials.json | requests are JSON Errors: HTTP status + JSON error message
The documented operations include transfers, swaps, bridges, withdrawals, trading, and checkout-related actions, but the guide does not prominently warn that these may irreversibly spend assets or execute real financial transactions. In a user-invocable agent skill, weak safety prompts increase the chance of accidental or socially engineered asset loss.
The skill includes a generic remote-fetch primitive that accepts an arbitrary URL and can attach payment behavior, which is much broader than necessary for wallet management. In an agent setting, this creates a powerful SSRF-like/exfiltration/payment gadget: an attacker can steer the agent to contact third-party endpoints and potentially spend wallet funds automatically.
The checkout section mentions dryRun as an option but does not clearly emphasize that setting dryRun to false can place an actual Amazon order. Because checkout is asynchronous and looks similar to a preview flow, users or higher-level agents may unintentionally trigger real purchases.
The x402 flow explicitly states it can automatically create and sign a USDC payment and retry the request, but the warning about automatic spending is not prominent where the feature is introduced. This makes the feature especially risky because a seemingly simple fetch can silently become a paid transaction to an attacker-chosen service.
The manifest presents a wallet API skill, but it also exposes x402_fetch, a generic paid remote-fetch capability to arbitrary services. That meaningfully broadens the trust boundary from wallet operations to general outbound requests with automatic payment, which can be abused to exfiltrate data to third parties or spend funds on unintended services.
The manifest frames the skill as wallet management, but the file also documents Amazon purchasing flows that can trigger real-world spending outside the stated scope. This scope expansion is dangerous because agents or reviewers may grant trust and permissions appropriate for a finance skill without realizing it also enables e-commerce purchases.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
## Why the steps matter (short rationale)
- **Register vs login**: agents create a new managed wallet tied to a human owner. That owner must explicitly claim the agent. Login is only for humans who already have an account.
- **Claim URL**: ensures the human owner explicitly links the agent to their account and controls allowlists/funding.
- **Credential persistence**: the `apiKey` is returned once (immediately for agent-first mode, or after device approval for standard mode). If you lose it, you must re-register or re-authenticate.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Step 1 — Start registration (agent-first recommended)
curl -sS -X POST "$SPONGE_API_URL/api/agents/register" \
-H "Content-Type: application/json" \
-d '{
"name":"YourAgentName",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -sS -X POST "$SPONGE_API_URL/api/agents/register" \
-H "Content-Type: application/json" \
-d '{
"name":"YourAgentName",
Unlike the API registration examples, this external transmission is to an arbitrary third-party URL via x402_fetch, not just the declared wallet backend. That broad outbound capability expands the attack surface by enabling third-party communication and paid requests under wallet credentials and funds.
-H "Authorization: Bearer $SPONGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url":"https://api.paysponge.com/api/services/purchase/svc_abc123/polymarket/markets?search=bitcoin&limit=5",
"method":"GET",
"preferred_chain":"base"
}'
No suspicious patterns detected.