T09 · Insecure Skill Coding Practices
- Location
scripts/pay.py:299- Finding
Advertised Payment Cap Can Be Bypassed Through the Direct EIP-3009 Signing Command
- Content
View full analysis
MAX_AMOUNT: raise ValueError( f"Payment amount {amount} exceeds hard cap {MAX_AMOUNT} " f"(${amount / 1_000_000:.2f} > ${MAX_AMOUNT / 1_000_000:.2f} USDC). " f"Signing refused — possible malicious server." ) ``` The direct signing command bypasses that function and passes the user-controlled amount directly to the signer: ```python def cmd_sign_eip3009(args): """Sign an EIP-3009 transferWithAuthorization.""" result = sign_eip3009( private_key=args.private_key, token_address=args.token, chain_id=args.chain_id, to=args.to, amount=args.amount, token_name=args.token_name, token_version=args.token_version, max_timeout=args.max_timeout, ) print(json.dumps(result, indent=2)) ``` ### Technical Analysis The project documentation states that the `$1.00 USDC` hard cap is enforced unconditionally ...[truncated 1884 chars]- Remediation
View remediation
int: amount = int(amount) if amount <= 0: raise ValueError("Payment amount must be positive") if amount > MAX_USDC_AMOUNT: raise ValueError("Payment amount exceeds the $1.00 USDC hard cap") return amount def sign_eip3009(..., amount, ...): amount = validate_payment_amount(amount) ... ``` ]]>
