# Attacker can front-run Withdraw and steal the withdrawal

Withdraw message sends tokens to info.sender without binding to the staker, so an attacker front-runs a valid withdrawal proof and steals the funds.

- Payout: Audit contest
- Severity: high
- Program: Seda Protocol
- Found by: 000000
- Disclosed: 2024-12-20
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-12-seda-protocol-judging/issues/231
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-12-seda-protocol%3AH-8
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:solidity technique:source-review vuln:access-control vuln:business-logic vuln:signature-replay

**Target:** CosmWasm staking Withdraw execute message
**Root cause:** Withdraw sends the withdrawn coins to info.sender and performs no check that the sender is the legitimate staker, so the message is replayable by anyone who observes it.
**Steps:**
1. Observe a valid Withdraw execute message (with proof) submitted by a staker.
2. Front-run it by submitting the identical message from attacker's own account.
3. Contract sends `coins(amount, token)` to `info.sender` (the attacker), draining the withdrawal.
**How found:** Code review of the Withdraw handler: noticed tokens are sent to `info.sender` and that no sender validation exists, making the message replayable by any observer.
**Exploitation:** Attacker monitors the mempool for a valid Withdraw message, copies it, and submits it with higher priority so the contract pays the withdrawn amount to the attacker's address instead of the staker.
**Insight:** In CosmWasm execute handlers, any message that pays out based on message content rather than an authenticated owner is front-runnable; check that payout recipients are bound to the staker/owner, not `info.sender`.

