Reproduced Exploit

EigenLayer — Beacon chain withdrawals at lastWithdrawalTimestamp are lost

1. activateRestaking sets mostRecentWithdrawalTimestamp = block.timestamp and sweeps pod ETH. 2. Beacon-chain withdrawals for that timestamp execute after user txs (EIP-4895). 3. verifyAndProcessWithdrawals requires timestamp > mostRecentWithdrawalTimestamp. 4. A proof for the same timestamp is rej…

Mar 2024Otheruntagged2 min read

Chain

Other

Category

untagged

Date

Mar 2024

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 40684-beacon-chain-withdrawals-that-occur-at-lastwithdrawaltimesta. Standalone Foundry PoC and full write-up: 40684-beacon-chain-withdrawals-that-occur-at-lastwithdrawaltimesta_exp in the evm-hack-registry mirror.


Vulnerability classes: frozen-funds · locked-funds · timestamp-dependence

Reproduction: self-contained Foundry PoC with only forge-std — no fork. output.txt · test/40684-…sol.

AuditVault taxonomy: lang/solidity · platform/cantina · severity/high · sector/restaking · sector/staking · genome: frozen-funds · locked-funds · timestamp-dependence


Key info#

ImpactHIGH — 32 ETH beacon withdrawal permanently stuck when restaking is activated in the same block
ProtocolEigenLayer — EigenPod.proofIsForValidTimestamp / activateRestaking
Vulnerable codetimestamp > mostRecentWithdrawalTimestamp (should be >=)
Bug classOff-by-one timestamp guard / EIP-4895 ordering
FindingCantina — EigenLayer, Mar 2024 · #40684 · reporter hash
Reportcantina_competition_eigenlayer_mar2024.pdf
SourceAuditVault
FixUse >= mostRecentWithdrawalTimestamp
Compiler^0.8.24 (PoC)

TL;DR#

  1. activateRestaking sets mostRecentWithdrawalTimestamp = block.timestamp and sweeps pod ETH.
  2. Beacon-chain withdrawals for that timestamp execute after user txs (EIP-4895).
  3. verifyAndProcessWithdrawals requires timestamp > mostRecentWithdrawalTimestamp.
  4. A proof for the same timestamp is rejected — the ETH can never be claimed.

Diagrams#

sequenceDiagram participant User participant Pod as EigenPod participant Beacon as Beacon chain EIP-4895 User->>Pod: activateRestaking at T Note over Pod: mostRecentWithdrawalTimestamp = T, balance swept Beacon->>Pod: credit 32 ETH withdrawal at T after user txs User->>Pod: verifyAndProcessWithdrawals proof ts=T Pod-->>User: revert timestamp not greater than mostRecent Note over Pod: 32 ETH stuck forever

Impact#

Beacon withdrawals that share a block/timestamp with activateRestaking (or any _processWithdrawalBeforeRestaking) are unrecoverable under the strict > guard.

Sources#

  • AuditVault #40684
  • Cantina EigenLayer Mar 2024
  • Reduced from EigenPod.sol (proofIsForValidTimestamp, _processWithdrawalBeforeRestaking) as quoted in the finding; fixed form appears in Layr-Labs/eigenlayer-contracts@v0.2.3-mainnet-m2 with >=

Sources & further analysis#

Reproductions & code

Alerts & third-party analyses

  • Web3Sec X hacked database: search.
  • Rekt leaderboard: search.
  • Solodit incident search: search.

These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.