# `DineroWithdrawRequestManager` vulnerable to token overwithdrawal via batch ID overlap

DineroWithdrawRequestManager redeems all upxETH in a batch-ID range, so overlapping batch IDs let a front-runner drain tokens owed to another user's withdrawal.

- Payout: Audit contest
- Severity: high
- Program: Notional
- Found by: 0xc0ffEE
- Disclosed: 2025-06-27
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2025-06-notional-exponent-judging/issues/297
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-06-notional-exponent%3AH-3
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic vuln:race-condition

**Target:** DineroWithdrawRequestManager / PirexETH redemption batch IDs
**Root cause:** _initiateWithdrawImpl stores only [initialBatchId, finalBatchId] and _finalizeWithdrawImpl redeems the full upxETH balance of every ID in that range; PirexETH mints partial allocations into the current batchId, so ranges of concurrent requests overlap and balances are not tracked per request.
**Steps:**
1. User A calls initiateWithdraw; PirexETH mints upxETH into batch IDs 1 and 2; requestId encodes [1,2].
2. User B calls initiateWithdraw; PirexETH mints into batch IDs 2 and 3; requestId encodes [2,3].
3. User A (or attacker front-running B) finalizes first: loop i=1..2 redeems `upxETH.balanceOf(address(this), i)`, zeroing batch 2.
4. User B finalizes: batch 2 balance is 0, only batch 3 redeemed; B receives less than owed.
**How found:** Code review of the requestId encoding and finalize loop: noticed finalize redeems the entire contract balance per batch ID rather than a per-request amount, then traced PirexETH._initiateRedemption to confirm batchId is reused across requests, producing overlapping ranges.
**Exploitation:** Attacker front-runs a victim's withdrawal request so their own request's batch-ID range overlaps the victim's, then finalizes first to redeem the shared batch's upxETH balance, extracting more ETH than their own deposit while the victim's later finalize finds a zero balance.
**Insight:** When a request ID encodes a range of external IDs and finalize reads live balances over that range, check whether the external system reuses IDs across concurrent requests; per-request accounting must snapshot deltas, not read shared balances.

