T09 · Insecure Skill Coding Practices
- Location
scripts/list-approvals.ts:76- Finding
Untrusted x402 Challenges Can Produce Arbitrary Token Transfer Authorizations
- Content
View full analysis
- Remediation
View remediation
MAX_PAYMENT) { throw new Error("Payment amount exceeds local policy"); } ``` 3. Require `JANUS_API_URL` to use HTTPS and pin its hostname to the documented service unless the user explicitly enables a development override. 4. Validate the final response URL after redirects, or disable cross-origin redirects for payment requests. 5. Treat token name and version as locally trusted constants after validating the token contract rather than accepting arbitrary values from the challenge. 6. Enforce strict timeout bounds and reject negative, zero, non-integer, or excessive timing values. 7. Display the token, amount, recipient, and expiration before signing. Require explicit confirmation whenever a value differs from the expected command policy. 8. Consolidate the duplicated payment implementation into one reviewed helper and add tests with malicious challenges covering arbitrary assets, recipients, amounts, networks, ...[truncated 171 chars]
