Reproduced Exploit
Cork — Attacker can perform MEV by providing amountOutMin = 0 for ERC-2612 permit swaps
1. User signs an EIP-2612 permit so the router can pull RA without a prior approve tx. 2. Any third party can submit that permit to swapRaforDs(..., amountOutMin, user, sig, ...). 3. Attacker sets amountOutMin = 0, frontruns by dumping into the AMM, then lands the victim swap at a ruined rate. 4. V…
Chain
Other
Category
untagged
Date
Dec 2024
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: 53124-attacker-can-perform-mev-by-providing-amountoutmin-0-for-all. Standalone Foundry PoC and full write-up: 53124-attacker-can-perform-mev-by-providing-amountoutmin-0-for-all_exp in the
evm-hack-registrymirror.
Vulnerability classes: impact/mev/frontrun · spot-price · frontrun-exposure
Reproduction: self-contained Foundry PoC with only
forge-std— no fork. output.txt · test/53124-…_exp.sol.
AuditVault taxonomy: lang/solidity · sector/dex · platform/cantina · severity/high · impact/mev/frontrun · genome: spot-price · frontrun · frontrun-exposure
Key info#
| Impact | HIGH — anyone holding a valid user permit can submit the swap with amountOutMin = 0, disable slippage protection, and sandwich the victim |
| Protocol | Cork Protocol — FlashSwapRouter permit-based RA↔DS swaps |
| Vulnerable code | swapRaforDs / swapDsforRa accept caller-chosen amountOutMin after consuming the user's permit |
| Bug class | Slippage parameter not bound into the permit signature; third-party submission |
| Finding | Cantina — Cork, December 2024 · #53124 · reporter 0xDjango |
| Report | cantina_competition_cork_december2024.pdf |
| Source | AuditVault |
| Fix | Cork PR 280 — do not allow free amountOutMin on permit-initiated swaps |
| Compiler | ^0.8.24 (PoC) |
TL;DR#
- User signs an EIP-2612 permit so the router can pull RA without a prior
approvetx. - Any third party can submit that permit to
swapRaforDs(..., amountOutMin, user, sig, ...). - Attacker sets
amountOutMin = 0, frontruns by dumping into the AMM, then lands the victim swap at a ruined rate. - Victim loses full input RA and receives far less DS than a fair quote; attacker extracts from the dump leg.
Diagrams#
Impact#
Material value extraction from any user who issues a permit for the flash-swap router without binding a minimum output into the signed payload.
Sources#
- AuditVault #53124
- Cantina Cork Dec 2024
- Reduced FlashSwapRouter permit path from the finding quote (Cork PR 280 fixed)
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 53124-attacker-can-perform-mev-by-providing-amountoutmin-0-for-all_exp (evm-hack-registry mirror).
- AuditVault finding: 53124-attacker-can-perform-mev-by-providing-amountoutmin-0-for-all.
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.