T09 · Insecure Skill Coding Practices
- Location
SKILL.md:88- Finding
Untrusted Payment Terms Are Signed Without Local Policy Validation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 88-94
Vulnerability Type: Missing validation of externally supplied cryptocurrency payment terms
Risk Level: Highjavascript const paymentRequired = httpClient.getPaymentRequiredResponse( (name) => res.headers.get(name), await res.json() ); const payload = await httpClient.createPaymentPayload(paymentRequired);Technical Analysis
The example treats payment requirements returned by the remote API as trusted input and immediately creates a signed EIP-3009 payment payload. Although the documentation states that a request costs
$0.01 USDCon Base mainnet, the code does not independently enforce:- The maximum or exact payment amount
- The expected USDC token contract
- The intended payment recipient
- The expected chain and network
- An acceptable authorization validity period
- The expected payment scheme
- A relationship between the payment request and the requested endpoint
Registering an EVM payment implementation for Base does not, by itself, enforce the documented price or intended recipient. If the API origin or its valid HTTPS response is compromised, it could provide altered payment terms that the configured wallet signs automatically.
Attack Path
- A user invokes one of the documented paid BondTerminal endpoints.
- The API server, or an attacker capable of controlling its valid HTTPS response, returns HTTP
402containing manipulated payment requirements. - The client parses the attacker-controlled response using
getPaymentRequiredResponse. - The code passes those terms directly to
createPaymentPayloadwithout checking the amount, asset, recipient, network, or expiration. - The configured wallet signs the resulting EIP-3009 authorization.
- The signed authorization is returned to the remote service and may be submitted for settlement.
Impact Assessment
Successful exploitation could auth ...[truncated 412 chars]
- Remediation
View remediation
Remediation Suggestions
- Define an explicit local payment policy before creating any signature.
- Verify that the chain ID is exactly Base mainnet (
eip155:8453). - Allow only the expected canonical USDC contract address.
- Allow only a documented and independently verified recipient address.
- Convert the amount to atomic token units and reject any amount above the documented
$0.01charge. - Validate authorization start and expiration times against a short permitted window.
- Verify that the requested payment scheme and API endpoint match the intended operation.
- Reject payment requirements containing unknown or duplicate fields instead of silently accepting them.
- Require explicit user confirmation whenever payment terms differ from a previously approved policy.
- Use a dedicated low-balance wallet with a strict spending budget rather than a general-purpose wallet.
- Add automated negative tests proving that altered amounts, assets, recipients, networks, and expiration periods are rejected before
signTypedDatacan be called.
