Reproduced Exploit

Blueberry: an approved withdraw burns the owner's shares and leaves their request open

Redeem requests are stored per user. withdraw lets an approved spender burn the owner's shares, but _beforeWithdraw reads requests[msg.sender]. Address1 and Address2 each request 400 shares, and Address2 approves Address1. Address1 withdraws 400 with owner set to Address2. Address1's request is cle…

Mar 2025•Ethereum•access-control•3 min read

Loss

400 USDC stays in the deposit escrow. The remaining holder's 1200-share redeem reverts

Chain

Ethereum

Category

access-control

Date

Mar 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: 61458-h-05-user-can-drain-escrow-via-approved-withdrawals-pashov-a. Standalone Foundry PoC and full write-up: 61458-h-05-user-can-drain-escrow-via-approved-withdrawals-pashov-a_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/access-control/missing-auth · vuln/logic/incorrect-state-transition

Key info#

FieldValue
Loss400 USDC stays in the deposit escrow. The remaining holder's 1200-share redeem reverts
Vulnerable contractVault._beforeWithdraw
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-03
Compilersolc 0.8.27, cancun, via IR
Bug classredeem request is debited from msg.sender

TL;DR#

Redeem requests are stored per user. withdraw lets an approved spender burn the owner's shares, but _beforeWithdraw reads requests[msg.sender]. Address1 and Address2 each request 400 shares, and Address2 approves Address1. Address1 withdraws 400 with owner set to Address2. Address1's request is cleared and Address2's shares are burned. Address2's request still says 400 assets. Address1 then requests and withdraws its own 400, so it receives 800 USDC, the fair amount for the two addresses it controls. Address2 can no longer withdraw, because its share balance is 0. The innocent holder of the other 1200 shares cannot redeem them: the redeem escrow only has 800 left, and 400 sits in the deposit escrow against the dead request.

The vulnerable code#

SOLIDITY
function _beforeWithdraw(uint256 assets_, uint256 shares_) internal {
    Request storage request = requests[msg.sender]; // @> VULN: approved withdraw debits the caller and burns the owner's shares
    require(request.assets >= assets_, "assets");
    require(request.shares >= shares_, "shares");
    request.assets -= assets_;
    request.shares -= shares_;
}

The fix passes owner into the hook and debits requests[owner].

Root cause#

The ERC-4626 withdraw path separates the caller from the share owner. The request accounting does not. A caller with their own request can spend it to burn someone else's shares, and the owner's request is left pointing at assets that can never be released.

Preconditions#

  • Redeem escrow holds 2000 USDC. Share price is 1.
  • Address1 and Address2 each hold 400 shares. Another holder has 1200.
  • Address2 has approved Address1. Both have an open 400-asset redeem request.

Attack walkthrough#

  1. Address2 approves Address1. Both call requestRedeem(400). Redeem escrow is 1200. Deposit escrow is 800.
  2. Address1 calls withdraw(400, address1, address2). The hook debits Address1. The vault burns Address2.
  3. Address1 requests its remaining 400 shares and withdraws them. It now holds 800 USDC.
  4. Address2's request is still 400 assets and 400 shares, and its balance is 0. withdraw reverts on the burn.
  5. The innocent holder's requestRedeem(1200) reverts. Deposit escrow still holds 400. Redeem escrow holds 800.

Diagrams#

flowchart TD A["Address1 and Address2 each request 400 shares"] --> B["Address1 withdraws with owner set to Address2"] B --> C["VULN hook debits Address1's request"] C --> D["Vault burns Address2's shares"] D --> E["Address2's request still claims 400 USDC"] E --> F["Address2's withdraw reverts and the other holder cannot redeem 1200 shares"]

Impact#

400 USDC cannot be paid to anyone. The holder of the remaining 1200 shares cannot exit. Address2's claim is permanently unusable because the shares it would burn are already gone.

Remediation#

Debit requests[owner], and require the owner to be the user whose shares are burned.

How to reproduce#

BASH
cd 61458-h-05-user-can-drain-escrow-via-approved-withdrawals-pashov-a_exp
forge test -vv

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.