Reproduced Exploit
Pear: Any caller redeems a victim's ERC4626 vault shares to themselves — victim's 1000e18 shares
Chain
Other
Category
untagged
Date
Jan 1970
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
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.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 65286-c-01-missing-authorization-in-withdraw-and-redeem-allows-the. The historical source/toolchain is unavailable; this entry is documentation only and claims no executable Forge PoC.
Vulnerability classes: vuln/theft
Reproduction: a faithful minimal reproduction of the vulnerable finding — the vulnerable function is reproduced verbatim (marked
@>) with faithful minimal doubles; local deploy, no fork.
Root cause#
Any caller redeems a victim's ERC4626 vault shares to themselves — victim's 1000e18 shares are burned to 0 and 1000e18 underlying is transferred to the attacker EOA, draining all depositors.
function _withdrawWithFee(uint256 shares, address user, address receiver) internal returns (uint256) {
// code
uint256 assetsToTransfer = super.previewRedeem(shares); // fee == 0 -> full asset value
super._withdraw(
user, // @> caller (same as owner to avoid allowance check) -> super._withdraw skips _spendAllowance, so ANY attacker may pass a victim as `user`
receiver, // receiver
Why it's exploitable here#
Any caller redeems a victim's ERC4626 vault shares to themselves — victim's 1000e18 shares are burned to 0 and 1000e18 underlying is transferred to the attacker EOA, draining all depositors.
Attack path#
Marked-line walkthrough (Playground)#
The EVM Playground pins each step to the exact executed source line in 0x671d353a77…:
- L41 — Setup: mock token contract: Setup:
MiniTokenis the underlying ERC20 the vault holds and pays out; test scaffolding. - L121 — Setup: credit token balance: Setup: internal mint credits
_balances[to], used to fund the victim's 1000e18 deposit. - L156 — Preview withdraw shares helper:
previewWithdrawconverts an asset amount to shares; a read-only helper on the withdraw path. - L219 — redeem takes arbitrary owner:
redeemaccepts a caller-supplieduser(share owner) alongsidereceiver— the parameter an attacker sets to the victim. - L226 — Only checks victim's balance: The sole guard verifies
userholds enough shares — never thatmsg.senderis authorized to spend them. - L256 — Compute assets to transfer:
previewRedeemyields the underlying owed for the victim's shares that will be handed to the attacker'sreceiver. - L257 — Withdraw without authorization: Root-cause bug:
_withdrawburnsuser's shares and sends assets toreceiverwith no allowance or owner check, so anyone drains any holder.
PoC#
Registry (Foundry, local deploy — verbatim vulnerable source + harm-asserting test + negative control):
cd 65286-c-01-missing-authorization-in-withdraw-and-redeem-allows-the_exp
forge test -vvv
The browser Playground replays the same synthetic opcode-for-opcode and measures the harm: Any caller redeems a victim's ERC4626 vault shares to themselves — victim's 1000e18 shares are burned to 0 and 1000e18 underlying is transfe. Both gates are green (registry forge test PASS + Playground _verify-poc VERDICT: PASS).
Sources & further analysis#
Reproductions & code
- No executable Forge reproduction is claimed; the historical source/toolchain was unavailable for this finding.
- AuditVault finding: 65286-c-01-missing-authorization-in-withdraw-and-redeem-allows-the.
- Upstream DeFiHackLabs PoC directory: src/test.
Alerts & third-party analyses
- DeFiHackLabs incident explorer: search "Pear: Any caller redeems a victim's ERC4626 vault shares to themselves".
- 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.