# Deposits may be front-run by malicious operator to steal ETH

Malicious operator front-runs stakeETH deposit with 1 ETH using same validator key but different withdrawal credentials, capturing 32 ETH.

- Payout: Contest reward
- Severity: high
- Program: Rio Network Core Protocol
- Credited: giraffe
- Disclosed: 2024-02-14
- Write-up quality: 8/10
- Original: https://github.com/sherlock-audit/2024-02-rio-network-core-protocol-judging/issues/55
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-02-rio-network-core-protocol%3AH-4
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm technique:race-window vuln:business-logic

**Target:** RioLRTOperatorDelegator.stakeETH / Beacon chain deposit contract
**Root cause:** Validator deposit uses operator-supplied withdrawal credentials; a prior 1 ETH deposit with same pubkey but attacker-controlled credentials is not overwritten, so the validator's 32 ETH is controlled by the operator.
**Steps:**
1. Operator registers validator pubkey/signature with withdrawal credentials pointing to OperatorDelegator's EigenPod.
2. Before Rio calls `stakeETH()`, operator deposits 1 ETH to Beacon deposit contract with same pubkey/signature but withdrawal credentials controlled by operator.
3. Rio's `eigenPodManager.stake{value: 32 ETH}(publicKey, signature, depositDataRoot)` succeeds but withdrawal credentials remain operator-controlled.
4. Validator now holds 1 ETH operator funds + 32 ETH Rio funds, all withdrawable by operator.
**How found:** Applied known deposit-contract front-running vulnerability from ethresear.ch to Rio's operator staking flow, noting operator-supplied withdrawal credentials and lack of guardian check.
**Exploitation:** Operator waits for rebalance to trigger stakeETH, front-runs with 1 ETH deposit using same validator key but attacker withdrawal credentials; Rio's 32 ETH deposit is accepted without overwriting credentials, giving operator full control of 33 ETH.
**Escalation:** Chain multiple rebalances without delay to deposit up to or beyond 3200 ETH soft cap, multiplying stolen funds.
**Insight:** In delegated staking, check whether validator withdrawal credentials are fixed before deposit; a 1 ETH front-run with same pubkey can capture the full 32 ETH if credentials aren't enforced.
