Reproduced Exploit
Fungify liquidation reverts after interest was already accrued in the block
liquidate uses the return value of accrueInterest as the exchange rate. If this block already accrued, accrueInterest returns 0. The freshness check reverts when that rate is 0.
Loss
100 of collateral is not seized. Liquidation reverts because a same-block accrue returns 0
Chain
Ethereum
Category
logic
Date
Nov 2023
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: 62381-fng-15-cerc721-liquidation-will-always-revert-if-interest-st. Standalone Foundry PoC and full write-up: 62381-fng-15-cerc721-liquidation-will-always-revert-if-interest-st_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/logic/liquidation-freshness · vuln/dos/blocked-liquidation
Key info#
| Field | Value |
|---|---|
| Loss | 100 of collateral is not seized. Liquidation reverts because a same-block accrue returns 0 |
| Vulnerable contract | CToken.liquidate |
| Attacker EOA | 0x1111111111111111111111111111111111111111 |
| Attack contract | Exploit at 0x15452ec016c4dc8c549e7fe6ff4b26324ea8b7a4 |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 2023-11 |
| Compiler | solc 0.8.27, cancun, via IR |
| Bug class | accrueInterest returns 0 on the same-block short-circuit and the freshness check treats that as stale |
TL;DR#
liquidate uses the return value of accrueInterest as the exchange rate. If this block already accrued, accrueInterest returns 0. The freshness check reverts when that rate is 0.
The market holds 100 of collateral and an exchange rate of 2 ether. The first accrue in the transaction returns 2 ether and records the block. The liquidation's accrue then returns 0, and LiquidateFreshnessCheck reverts. collateral is still 100 and nothing is seized.
The fixed accrue returns the stored exchange rate on that short-circuit. Liquidation seizes the 100.
The vulnerable code#
if (accrualBlockNumber == currentBlockNumber) {
return NO_ERROR;
}
if (accrualBlockNumber != block.number || assetsExchangeRate == 0) {
lastSeized = assetsExchangeRate; // @> VULN: the same-block accrue returned 0, so the 100 is not seized
return 0;
}
NO_ERROR is 0. The quoted _liquidateBorrow reverts with LiquidateFreshnessCheck on that 0. This model takes the same branch and returns without seizing.
Impact#
A liquidation that should seize 100 of collateral reverts. The collateral stays in the market. Calling accrueInterest earlier in the same block is enough to cause it.
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 62381-fng-15-cerc721-liquidation-will-always-revert-if-interest-st_exp (evm-hack-registry mirror).
- AuditVault finding: 62381-fng-15-cerc721-liquidation-will-always-revert-if-interest-st.
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.