Reproduced Exploit

Notional Exponent: the first Dinero finalizer takes the overlapped batch

Pirex mints upxETH in 32 ETH batches. A 40 ETH redemption fills batch 1 with 32 and leaves 8 on the still-open batch 2. The next 40 ETH redemption adds 24 to that same batch 2 and opens batch 3 with 16. _finalizeWithdrawImpl walks the caller's batch range and redeems the manager's entire balance of…

Jun 2025•Ethereum•logic•4 min read

Loss

24 WETH taken from the next withdrawal. Attacker receives 64 on a 40 request. Victim is left with 16 of 40

Chain

Ethereum

Category

logic

Date

Jun 2025

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. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 62484-h-3-dinerowithdrawrequestmanager-vulnerable-to-token-overwit. Standalone Foundry PoC and full write-up: 62484-h-3-dinerowithdrawrequestmanager-vulnerable-to-token-overwit_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/logic/state-update · vuln/logic/incorrect-state-transition

Key info#

FieldValue
Loss24 WETH taken from the next withdrawal. Attacker receives 64 on a 40 request. Victim is left with 16 of 40
Vulnerable contractDineroWithdrawRequestManager._finalizeWithdrawImpl
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run() with 80 ETH
Chain / block / dateEthereum model · block 0 · 2025-06
Compilersolc 0.8.27, cancun, via IR
Bug classFinalize redeems upxETH.balanceOf(this, batchId), which is every request that landed in that batch

TL;DR#

Pirex mints upxETH in 32 ETH batches. A 40 ETH redemption fills batch 1 with 32 and leaves 8 on the still-open batch 2. The next 40 ETH redemption adds 24 to that same batch 2 and opens batch 3 with 16. _finalizeWithdrawImpl walks the caller's batch range and redeems the manager's entire balance of each id. The first finalizer takes batch 2's 32, including the other user's 24. They receive 64 WETH. The victim receives 16.

The vulnerable code#

SOLIDITY
for (uint256 i = initialBatchId; i <= finalBatchId; i++) {
    uint256 assets = upxETH.balanceOf(address(this), i); // @> VULN
    if (assets == 0) continue;
    PirexETH.redeemWithUpxEth(i, assets, address(this));
    tokensClaimed += assets;
}

The judging fix records, at initiate time, how much of each batch belonged to that request, and finalizes only that amount.

Root cause#

_initiateWithdrawImpl returns nonce << 240 | initialBatchId << 120 | finalBatchId. The nonce makes the id unique. The claim does not. Two requests can share a batch because _initiateRedemption keeps minting into batchId until another 32 ETH has accumulated. Finalize ignores the per-request split and burns whatever the manager holds for that id.

Preconditions#

  • DEPOSIT_SIZE is 32 ETH. Both users redeem 40 pxETH, so each request spans two batches and the ranges overlap on batch 2.
  • Validators are already dissolved, so canFinalizeWithdrawRequest is true. The wait is not the bug. Pirex holds 80 ETH to pay both redemptions.

Attack walkthrough#

  1. The attacker initiates 40 pxETH. Batch 1 is minted 32. Batch 2 is minted the 8 remainder. The stored range is 1 to 2.
  2. The victim initiates 40 pxETH. Batch 2 grows by 24, to 32. Batch 3 is minted 16. The stored range is 2 to 3.
  3. The attacker finalizes first. The loop redeems batch 1 (32) and batch 2 (32). They receive 64 WETH.
  4. The victim finalizes. Batch 2 is empty. Batch 3 pays 16 WETH.
  5. 24 WETH, the amount above the attacker's own 40, is transferred to the sink.

Diagrams#

flowchart TD A["Attacker redeems 40 pxETH into batches 1 and 2"] --> B["Victim redeems 40 pxETH into batches 2 and 3"] B --> C["Batch 2 now holds 8 from the attacker and 24 from the victim"] C --> D["VULN finalize redeems the whole balance of each batch in the range"] D --> E["Attacker receives 64 WETH"] E --> F["Victim receives only batch 3, which is 16 WETH"]

Impact#

The first user to finalize an overlapping batch is paid the other user's upxETH in that batch. Here that is 24 ETH. The victim asked to withdraw 40 ETH and receives 16. The attacker's fair share was 40. They keep 40 and the sink holds the stolen 24.

How to reproduce#

BASH
cd 62484-h-3-dinerowithdrawrequestmanager-vulnerable-to-token-overwit_exp
forge test -vv

test_first_finalizer_takes_the_overlapped_batch sends 80 ETH into run, then checks the sink holds 24 WETH, the victim holds 16, and the attacker keeps 40.

Sources#


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.