Reproduced Exploit
The last vault claim pays the request plus the idle balance
claim treats the last withdrawal differently. When there is no shortfall it adds idleAssets() to the requested amount and transfers that sum. Idle assets are the balance that should stay for the next deposit.
Loss
A request of 100 is paid 150. The extra 50 is the vault's idle balance
Chain
Ethereum
Category
logic
Date
Nov 2024
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
The attack replays in your browser. Step through it by Solidity line or by opcode.
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.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 62399-loglab-15-last-withdrawer-could-give-next-depositor-0-shares. Standalone Foundry PoC and full write-up: 62399-loglab-15-last-withdrawer-could-give-next-depositor-0-shares_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/logic/last-withdraw · vuln/defi/overpayment
Key info#
| Field | Value |
|---|---|
| Loss | A request of 100 is paid 150. The extra 50 is the vault's idle balance |
| Vulnerable contract | Vault.claim |
| Attacker EOA | 0x1111111111111111111111111111111111111111 |
| Attack contract | Exploit at 0x15452ec016c4dc8c549e7fe6ff4b26324ea8b7a4 |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 2024-11 |
| Compiler | solc 0.8.27, cancun, via IR |
| Bug class | The last claim sets executedAssets to requestedAssets + idleAssets |
TL;DR#
claim treats the last withdrawal differently. When there is no shortfall it adds idleAssets() to the requested amount and transfers that sum. Idle assets are the balance that should stay for the next deposit.
The vault holds 150. The request is 100 and idle is 50. The last claim pays 150. The control pays 100 and leaves 50 in the vault.
The vulnerable code#
uint256 idleAssets = idle;
assetsToClaim += idleAssets;
executedAssets = requested + idleAssets; // @> VULN: the last claim pays the request plus every idle asset
Impact#
The last withdrawer takes the idle balance on top of their request. Here that is 50 extra, and the vault is emptied.
How to reproduce#
cd 62399-loglab-15-last-withdrawer-could-give-next-depositor-0-shares_exp
forge test -vv
test_exploit_last_claim_pays_idle asserts the caller receives 150. test_control_pays_the_request_only asserts a payment of 100 and 50 left in the vault.
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/62399-loglab-15-last-withdrawer-could-give-next-depositor-0-shares.md
- Hexens report: BasisOS, 2024-11-25
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 62399-loglab-15-last-withdrawer-could-give-next-depositor-0-shares_exp (evm-hack-registry mirror).
- AuditVault finding: 62399-loglab-15-last-withdrawer-could-give-next-depositor-0-shares.
Alerts & third-party analyses
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.