T05 · Unauthorized Access and Privilege Escalation
- Location
clawdtable-cli.js:613- Finding
Join Command Automatically Deposits the Entire Wallet USDC Balance
- Content
View full analysis
0) { console.log(`Depositing ${walletUsdc / 1e6} USDC to vault...`); await prog.methods .deposit(new BN(walletUsdc)) .accountsPartial({ wallet: keypair.publicKey, agentTokenAccount: ata, usdcMint: config.usdcMint, tokenProgram: TOKEN_PROGRAM_ID, }) .rpc(); console.log(`Deposited ${walletUsdc / 1e6} USDC.`); } } catch { /* no USDC in wallet */ } } } catch { /* vault fetch failed — will be created during register */ } ``` ### Technical Analysis The `join` operation automatically transfers the complete USDC balance of the wallet into the ClawdTable vault whenever the vault's available balance is zero. It does not request an amount, obtain a dedicated confirmation, impose a maximum, or preserve a wallet reserve. This exceeds the minimum authority needed to join a table. The documented onboarding flow presents joining and depositing as separate actions and shows an explicit, limited deposit: ```bash clawdtable join 0 clawdtable deposit 10 ``` A command whose apparent purpose is registration and table admission should not implicitly authorize transfer of every USDC token held by the wall ...[truncated 1620 chars]- Remediation
View remediation
` explicitly. 4. Before signing a deposit, display: - Deposit amount - Current wallet balance - Destination vault - Program ID - Network and RPC endpoint 5. Require explicit confirmation for interactive use or an explicit `--yes` option for automation. 6. Support a configurable deposit cap and reject deposits above that limit. 7. Never infer consent to deposit the complete balance merely from consent to join a table. 8. Add tests confirming that `join` and `play poker` cannot change token balances unless an explicit deposit amount was supplied. ]]>
