T09 · Insecure Skill Coding Practices
- Location
src/x402.js:89- Finding
Fabricated Transaction Hashes Are Accepted as Valid Payments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This router mostly matches its stated purpose, but it includes under-controlled payment, local dashboard, and persistent learning features that need careful review before installation.
Install only if you are comfortable with a skill that automatically hooks model requests, keeps local routing and payment history, and exposes a local dashboard. Do not enable wallet/payment use unless you have external spend controls and explicit human approval; avoid exposing port 9093 beyond localhost, and treat the x402 Pro payment flow as not production-safe until transaction verification and wallet ownership checks are fixed.
src/x402.js:89Fabricated Transaction Hashes Are Accepted as Valid Payments
src/x402.js:83Payment Requests Are Not Bound to the Wallet Receiving the License
src/dashboard.js:42Dashboard APIs Expose Cross-Wallet Data and State Operations Without Authentication
src/dashboard.js:158Unauthenticated Test Requests Persistently Poison Routing State
src/selector.js:325Global Performance Scoring Allows Cross-Agent Routing Contamination
The documentation explicitly states that an agent can autonomously pay for Pro via x402 without human approval, which is a dangerous overreach for a routing utility. Any capability that can trigger financial transactions without informed consent can be abused or misfire, resulting in unauthorized charges and hard-to-reverse asset loss.
The skill states that an agent can subscribe and pay without human approval, but it does not describe a warning, confirmation step, or consent gate. This creates a direct risk of unauthorized purchases, especially in autonomous environments where the agent may be induced to justify subscriptions based on manipulated ROI assumptions.
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
const promptCost = (promptTokens / 1000) * model.cost_per_1k_prompt;
const completionCost = (completionTokens / 1000) * model.cost_per_1k_completion;
return promptCost + completionCost;
}
/**
The payment verification flow grants Pro access based on a transaction hash that merely has sufficient length, without validating that the transaction exists on-chain or that it paid the correct recipient, amount, token, or chain. An attacker can submit an arbitrary long string as txHash and receive paid features for free, undermining billing enforcement and enabling unauthorized quota/license escalation.
The API reference explicitly documents retrieval and storage of historical task patterns tied to an agent identifier, but it does not mention data retention limits, consent, minimization, or privacy controls. Because task analysis can include prompts, context, files, and conversation history, this creates a real risk of persistent storage of sensitive usage metadata or user content without adequate warning or governance.
The examples show database-backed learning through updateSelectionResults and stored routing decisions, which normalizes persistence of token usage, cost, success, quality, and timing metadata without any user-facing warning about retention or privacy implications. In a router that processes user prompts and task history, this can enable silent accumulation of behavioral and potentially sensitive operational data.
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.
- `incrementDecisionCount(agentWallet)` - Increment usage
- `resetDailyQuotaIfNeeded(agentWallet)` - Auto-reset on date change
- `getQuota(agentWallet)` - Get full quota info
- `initializeQuota(agentWallet)` - Create default quota
- `updateAgentTier(agentWallet, tier, paidUntil)` - Update subscription
**Payment Methods:**
The documentation explicitly describes retrieval and storage of task/request-derived metadata and historical patterns, but gives no warning about retention, visibility, minimization, or consent. In a routing component that processes arbitrary prompts and context, this can lead operators to persist potentially sensitive user content or derived characteristics without realizing the privacy implications.
The schema and integration sections document persistent database logging of routing decisions, task characteristics, wallet identifiers, outcomes, and learning data, yet omit any privacy warning or operational guidance. This is dangerous because implementers may deploy long-lived logging of sensitive behavioral metadata and identifiers without safeguards, increasing exposure in case of misuse, overcollection, or database compromise.
The README explicitly says agents can autonomously pay for the Pro tier and that no human approval is needed, but it does not provide an equally prominent warning that this triggers real-money spending. In an agent skill context, encouraging autonomous payment without clear guardrails can lead to unintended purchases, wallet misuse, or abuse if the agent or environment is compromised.
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.
claw router history --limit=10
# Test complexity analysis
claw router analyze "Write a simple hello world function"
# Open dashboard
claw router dashboard
The README states that the router intercepts every API request and analyzes task content, but its privacy section only reassures users that data is local and not sent externally. That can understate the sensitivity of prompts, code, secrets, and other request contents being inspected and persisted, increasing the risk that users enable it without informed consent or proper handling of sensitive material.
The skill advertises capabilities that imply shell, environment, and network access but does not declare any explicit tool scope or permissions boundary. This creates a transparency and containment failure: users and the host may invoke a skill with broader effective powers than expected, increasing the chance of unintended command execution, data access, or outbound communication.
The skill is presented primarily as a routing optimizer, but it also introduces monetization and subscription/payment behavior that is not central to that purpose. This scope expansion increases risk because users may install a cost-saving router without appreciating that it can also handle paid account actions and related network flows.
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.
Medium (0.3-0.6) → Sonnet:
- "Refactor this class to use interfaces"
- "Write unit tests for this function"
- "Explain how React hooks work"
Complex (0.6-0.8) → Opus:
The skill describes persistent learning from usage patterns and storage of routing memories across sessions, but it does not provide a strong warning about retention, sensitivity of stored prompts/metadata, or user controls. Persisted task patterns can reveal coding tasks, debugging content, research interests, or business context if accessed by other local users or compromised processes.
The privacy claims state that routing is local and that there are no external servers or API calls, yet the documented payment and license endpoints indicate networked interactions. Misleading privacy/security statements can cause users to expose queries, wallet identifiers, or usage metadata under false assumptions about locality and telemetry.
The schema persistently stores detailed agent and task telemetry including agent_wallet, task characteristics, routing behavior, model choices, performance, costs, and learned patterns. Even without direct secrets, this creates a rich behavioral dataset that can expose user activity, business-sensitive usage patterns, and potentially deanonymize agents if collected or accessed without clear disclosure, minimization, and access controls.
The migration comment explicitly describes enabling AI agents to autonomously pay for a Pro tier, which suggests the surrounding feature is designed to initiate payments without clear user opt-in, approval workflow, or policy/locale checks. In an agent skill, autonomous payment capability materially increases financial abuse risk because downstream code may normalize charging behavior as an expected system function.
The top-level CLI description says this tool provides 'Intelligent model selection for OpenClaw agents', which suggests routing/selection functionality. However, the file also exposes license management and a Pro subscription payment flow, including generating payment requests and payment verification instructions, which goes beyond model selection behavior into account monetization.
The subscribe command creates a payment request and instructs the user how to complete and verify a USDT payment over x402. For a skill whose stated purpose is smart routing/model selection, implementing a payment onboarding workflow is a distinct capability that is not obviously required by routing itself.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
console.log('Instructions:\n');
console.log(' 1. Send 0.5 USDT to the recipient address via x402 protocol');
console.log(' 2. After payment, verify with your transaction hash:\n');
console.log(` curl -X POST http://localhost:9093/api/x402/verify \\`);
console.log(` -H "Content-Type: application/json" \\`);
console.log(` -d '{`);
console.log(` "request_id": "${paymentRequest.request_id}",`);
The file-level description says this component is a REST API dashboard for routing operations, but a substantial portion of the code implements subscription billing and license/quota management endpoints. Those payment and entitlement features are materially broader than merely providing dashboard access to routing information and testing.
The router includes quota enforcement, license checks, and x402 payment handling, which expands its privileges and attack surface beyond model-routing orchestration. Even if intended as a product feature, combining routing with billing logic increases the risk of unauthorized charging, license abuse, or security flaws in payment flows being reachable through a component that callers may trust as a simple router.
The skill directly exposes payment-related methods such as creating payment requests and verifying blockchain payment transactions, despite its stated purpose being routing. This creates a confused-deputy risk: an agent or caller integrating the skill for routing may unknowingly inherit sensitive financial operations, enabling abuse, unexpected transaction handling, or trust-boundary violations if these methods are invoked without strict authorization controls.
No suspicious patterns detected.