# RocketPool and Lido Frontrunning Bugfix Review

Malicious node operator frontruns pool's 32 ETH deposit with a 1 ETH deposit using same validator pubkey and own withdrawal credentials, capturing pool funds.

- Payout: $200,000
- Severity: critical
- Program: Lido Finance
- Credited: Dmitri Tsumak
- Disclosed: 2021-10-11
- Write-up quality: 8/10
- Original: https://immunefi.com/blog/bug-fix-reviews/rocketpool-and-lido-frontrunning-bugfix-review/
- Library page: https://bugbountylibrary.com/r/blog%3Aimmunefi-com-blog-bug-fix-reviews-rocketpool-and-lido-frontrunning-bugfix-review
- Tags: domain:web3 impact:funds-loss kind:bounty platform:blog platform:immunefi sev:critical tech:evm technique:chained technique:source-review vuln:business-logic vuln:race-condition

**Target:** Ethereum 2.0 deposit contract / staking pool deposit flow
**Root cause:** Beacon chain process_deposit only checks signature for new pubkeys; a first deposit with attacker withdrawal credentials registers the validator, and subsequent pool deposits just increase its balance.
**Steps:**
1. Get approved as node operator with a validator BLS key
2. Pre-generate deposit data for that pubkey with attacker withdrawal credentials and minimum deposit (1 ETH, or 16 ETH on RocketPool)
3. Wait for pool to submit 32 ETH deposit for the validator
4. Frontrun by calling `deposit()` on the ETH2 deposit contract with attacker's data
5. Pool's 32 ETH deposit then hits the `else` branch and increases attacker-controlled validator balance
**How found:** After disclosing to RocketPool, researcher checked another staking service (Lido) and found the same systemic pattern; root cause traced by reading beacon-chain process_deposit spec logic.
**Exploitation:** Attacker registers validator first with own withdrawal credentials at minimal deposit; pool's subsequent 32 ETH deposit is credited to that validator, so attacker controls withdrawal credentials and can withdraw pool users' ETH.
**Escalation:** Same bug found systemically across two protocols (RocketPool then Lido), doubling payout.
**Insight:** When auditing pooled staking, check whether validator registration is first-deposit-wins and whether withdrawal credentials are bound at registration; any deposit flow where a later deposit only increases balance lets an attacker pre-register a key.
