Reproduced Exploit

VaultRouter redeems another owner's ERC4626 shares

The ERC4626 redeem command reads owner and receiver from the call. It does not require the caller to be owner. A user who approved the router so they can redeem their own shares has approved every caller.

Dec 2024•Ethereum•access-control•2 min read

Loss

A third party redeems 100 shares that another account approved to the router and receives 100 assets

Chain

Ethereum

Category

access-control

Date

Dec 2024

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

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.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 49646-h-07-malicious-actors-can-exploit-user-approved-allowances-o. Standalone Foundry PoC and full write-up: 49646-h-07-malicious-actors-can-exploit-user-approved-allowances-o_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/access-control/vault-redeem · vuln/defi/share-theft

Key info#

FieldValue
LossA third party redeems 100 shares that another account approved to the router and receives 100 assets
Vulnerable contractRouter.redeem
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit at 0x15452ec016c4dc8c549e7fe6ff4b26324ea8b7a4
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2024-12
Compilersolc 0.8.27, cancun, via IR
Bug classThe redeem command takes owner from calldata
flowchart TD A["The holder has 100 shares and has approved the router"] --> B["A third party calls redeem with that owner"] B --> C["VULN the vault burns the holder's shares"] C --> D["The attacker receives 100 assets"] B --> E["Control requires the caller to be the owner"] E --> F["The same call reverts and the 100 shares stay"]

TL;DR#

The ERC4626 redeem command reads owner and receiver from the call. It does not require the caller to be owner. A user who approved the router so they can redeem their own shares has approved every caller.

The holder has 100 shares and has approved the router. A third party redeems those shares to themselves. The holder has 0 shares. The attacker holds 100 assets.

The control requires msg.sender == owner. The call reverts and the shares stay.

The vulnerable code#

SOLIDITY
function redeem(Vault vault, uint256 shares, address receiver, address owner) external returns (uint256 assets) {
    assets = vault.redeem(shares, receiver, owner); // @> VULN: owner is taken from calldata, not from msg.sender
}

Impact#

A share approval given to the router is spendable by anyone. Here that redeems 100 shares into 100 assets for the caller.

How to reproduce#

BASH
cd 49646-h-07-malicious-actors-can-exploit-user-approved-allowances-o_exp
forge test -vv

test_exploit_third_party_redeems_the_owner asserts the attacker holds 100 assets. test_control_caller_must_be_owner asserts the call reverts and the holder keeps 100 shares.

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.