Reproduced Exploit

VaultRouter pushTokenFrom spends another user's ERC20 approval

Users approve VaultRouter so a later command can pull their tokens. pushTokenFrom only checks that allowance. from and to are arguments. A caller who is not the owner can send the approved balance anywhere.

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

Loss

A third party moves 10000 WETH from an account that approved the router

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: 49645-h-06-malicious-actors-can-exploit-user-approved-allowances-o. Standalone Foundry PoC and full write-up: 49645-h-06-malicious-actors-can-exploit-user-approved-allowances-o_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/access-control/allowance-router · vuln/defi/token-drain

Key info#

FieldValue
LossA third party moves 10000 WETH from an account that approved the router
Vulnerable contractRouter.pushTokenFrom
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 classpushTokenFrom checks the router's allowance and does not require the caller to be from
flowchart TD A["The holder has 10000 WETH and has approved the router"] --> B["A third party calls pushTokenFrom"] B --> C["VULN transferFrom uses the router's allowance"] C --> D["The attacker holds 10000 and the holder holds 0"] B --> E["Control requires the caller to be from"] E --> F["The same call reverts and the 10000 stays"]

TL;DR#

Users approve VaultRouter so a later command can pull their tokens. pushTokenFrom only checks that allowance. from and to are arguments. A caller who is not the owner can send the approved balance anywhere.

The holder has 10000 WETH and has approved the router. The third party pushes all 10000 to themselves. The holder is left with 0.

The control requires msg.sender == from. The same call reverts and the 10000 stays with the holder.

The vulnerable code#

SOLIDITY
function pushTokenFrom(Token token, address from, address to, uint256 amount) external {
    require(token.allowance(from, address(this)) >= amount, "NotEnoughAllowance");
    token.transferFrom(from, to, amount); // @> VULN: the caller is not required to be `from`
}

Impact#

An approval given to the router for deposits is spendable by anyone. Here that is 10000 WETH.

How to reproduce#

BASH
cd 49645-h-06-malicious-actors-can-exploit-user-approved-allowances-o_exp
forge test -vv

test_exploit_third_party_pushes_the_approval asserts the attacker holds 10000. test_control_caller_must_be_from asserts the call reverts and the holder keeps 10000.

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.