T09 · Insecure Skill Coding Practices
Warning
- Location
- references/adapter-private-key.md:20
- Finding
- Bridge examples execute fund transfers without mandatory confirmation or input validation<![CDATA[ ## Vulnerability Details **File Location**: `references/adapter-private-key.md:20-24,32` **Additional Locations**: `references/adapter-private-key.md:55-59,67`; `references/adapter-circle-wallets.md:36-48,56`; `references/adapter-wagmi.md:57-61` **Vulnerability Type**: Missing transaction confirmation and input validation **Risk Level**: Medium ### Vulnerable Code ```ts const result = await kit.bridge({ from: { adapter, chain: "Arc_Testnet" }, to: { adapter, chain: "Base_Sepolia" }, amount: "1.00", }); void bridgeUSDC(); ``` The same automatic execution pattern appears in the EVM-to-Solana and Circle Wallets examples: ```ts const result = await kit.bridge({ from: { adapter: evmAdapter, chain: "Ethereum_Sepolia" }, to: { adapter: solanaAdapter, chain: "Solana_Devnet" }, amount: "1.00", }); void bridgeUSDC(); ``` ```ts const result = await kit.bridge({ from: { adapter, chain: "Arc_Testnet", address: process.env.EVM_WALLET_ADDRESS!, }, to: { adapter, chain: "Solana_Devnet", address: process.env.SOLANA_WALLET_ADDRESS!, }, amount: "1.00", }); void bridgeUSDC(); ``` ### Technical Analysis The reference implementations call `kit.bridge()` without validating the source chain, destination chain, recipient address, amount, token, wallet balance, or selected network. The standalone examples then invoke `bridgeUSDC()` immediately, meaning that running the example can submit an approval, burn, attestation, and mint workflow without a separate confirmation boundary. This implementation contradicts the security rules in `SKILL.md:245-248`, which require explicit confirmation of the source chain, destination chain, recipient, amount, and token before bridging, as well as validation of all transaction inputs. The current examples use test networks and a fixed amount, which limits their immediate financial impact. However, they are presented as implementation patterns and can become unsafe when users replace ...[truncated 1262 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove automatic invocation such as `void bridgeUSDC()` from reference implementations. 2. Expose the bridge operation as a function that must be called only after an explicit confirmation step. 3. Before calling `kit.bridge()`, validate: - Source and destination chains against an allowlist. - That source and destination are not accidentally identical. - Recipient address syntax and network compatibility. - Amount as a positive, bounded decimal value. - Token identity and contract address. - Wallet balance and expected network fees. - Whether the selected environment is testnet or mainnet. 4. Display a final immutable transaction summary containing the token, amount, source chain, destination chain, recipient, forwarding-service use, and estimated fees. 5. Require explicit user confirmation immediately before submission, especially for mainnet operations. 6. Reject mainnet transfers unless mainnet use was explicitly selected and confirmed. 7. Add a configurable transfer limit and require stronger confirmation for high-value transactions. 8. Keep transaction construction separate from transaction submission so parameters can be reviewed and tested without moving funds. ]]>
