T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:605
- Finding
- Blind Signing of a Remotely Supplied Jupiter Transaction<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:605-609` **Vulnerability Type**: Blind signing of untrusted transaction data **Risk Level**: High ### Vulnerable Code ```typescript const swapTx = VersionedTransaction.deserialize( Buffer.from(swapResponse.swapTransaction, "base64"), ); swapTx.sign([wallet]); const sig = await connection.sendRawTransaction(swapTx.serialize()); ``` ### Technical Analysis The skill directs the agent to deserialize and sign a transaction returned by the remote Jupiter API without independently validating the transaction instructions. It does not verify: - The invoked Solana program IDs - Input and output token mints - Source and destination token accounts - Transfer amounts and minimum output - Recipients of funds - Token approvals or account-authority changes - Priority fees and other transaction costs - Whether the transaction corresponds to the quote and user-approved plan Although the skill states that the user should see a plan before execution, approval of a textual plan does not prove that the opaque transaction returned later by the external API implements that plan. The wallet keypair grants the ability to authorize transactions, so every instruction must be treated as untrusted until decoded and verified. ### Attack Path 1. The user approves a legitimate-looking token swap plan. 2. The agent requests a serialized swap transaction from the external Jupiter endpoint. 3. An attacker compromises the API, its upstream infrastructure, or another component in the response path. 4. The attacker returns a valid serialized transaction containing unintended transfers, approvals, excessive fees, or malicious program invocations. 5. The agent deserializes the response and signs it without inspecting its instructions. 6. The signed transaction is submitted to Solana and executes with the wallet’s authority. ### Impact Assessment Successful exploitation could authorize unintended movement of tokens held by the ...[truncated 468 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Decode every transaction instruction before signing. 2. Allowlist the expected Jupiter and Solana program IDs and reject unknown programs. 3. Verify that source accounts belong to the configured wallet. 4. Verify the exact input mint, output mint, maximum input amount, minimum output amount, recipients, slippage, and fee limits against the approved quote. 5. Reject unexpected authority changes, delegate approvals, account closures, and transfers to unrelated recipients. 6. Simulate the transaction and reject simulation errors or unexplained balance changes. 7. Display the independently verified transaction details and obtain explicit user confirmation immediately before signing. 8. Re-fetch wallet balances after execution and verify the expected token deltas. 9. Prefer constrained transaction construction or verified instruction generation over signing an opaque transaction blob. ]]>
