T09 · Insecure Skill Coding Practices
- Location
scripts/a2a_client.py:31- Finding
Origin-Unbound Wallet Signatures Can Be Sent to an Arbitrary Configured API
- Content
View full analysis
Dict[str, str]: """Sign API request for authentication.""" timestamp = str(int(time.time() * 1000)) body_hash = hashlib.sha256(body.encode()).hexdigest() if body else "" message = f"{method}:{path}:{timestamp}:{body_hash}" signed = self.account.sign_message(encode_defunct(text=message)) return { "X-Wallet-Address": self.wallet_address, "X-Timestamp": timestamp, "X-Signature": signed.signature.hex() } ``` The payment path also signs destination data supplied by the selected remote server: ```python payment_data = { "from": self.wallet_address, "to": payment_info.get("accepts", [{}])[0].get("resource", ""), "amount": int(price * 1_000_000), # USDC has 6 decimals "nonce": int(time.time() * 1000), "deadline": int(time.time()) + 3600 # 1 hour validity } message = json.dumps(payment_data, sort_keys=True) signed = self.account.sign_message(encode_defunct(text=message)) ``` ### Technical Analysis The client accepts an unrestricted API origin from either `A2A_MARKET_API_URL` or the constructor. It t ...[truncated 2843 chars]- Remediation
View remediation
