Reproduced Exploit

Polynomial — Exchange._liquidate burns too much powerPerp

When ShortCollateral caps collateral returned on an underwater short, Exchange still burns the full debtRepaying of powerPerp from the liquidator

Mar 2023Otherliquidation2 min read

Chain

Other

Category

liquidation

Date

Mar 2023

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

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.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 20224-h-01-exchange-liquidate-function-can-cause-liquidator-to-bur. Standalone Foundry PoC and full write-up: 20224-h-01-exchange-liquidate-function-can-cause-liquidator-to-bur_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/liquidation/over-burn · vuln/accounting/asymmetric-settlement

Reproduction: a self-contained Foundry PoC that compiles & runs in an isolated project with only forge-std — no fork, no RPC, no anvil_state. Full trace: output.txt. PoC: test/20224-h-01-exchange-liquidate-function-can-cause-liquidator-to-bur_exp.sol.

AuditVault taxonomy: lang/solidity · sector/lending · platform/code4rena · severity/high · genome: liquidation-logic · direct-drain


Key info#

ImpactHIGH — When ShortCollateral caps collateral returned on an underwater short, Exchange still burns the full debtRepaying of powerPerp from the liquidator
ProtocolPolynomial Protocol
FindingCode4rena — Polynomial Protocol, 2023-03 · #20224
Report2023-03-polynomial
SourceAuditVault
StatusAudit finding — reproduced as a standalone local synthetic PoC.
Compiler^0.8.24 (PoC)

TL;DR#

When ShortCollateral caps collateral returned on an underwater short, Exchange still burns the full debtRepaying of powerPerp from the liquidator

See the vulnerable line marked // @> VULN in test/20224-h-01-exchange-liquidate-function-can-cause-liquidator-to-bur.sol and the end-to-end Exploit.run() that asserts the harm.


Diagrams#

flowchart TD A[Setup vulnerable state] --> B[Attacker triggers vulnerable path] B --> C["Vulnerable line executes @> VULN"] C --> D[Harm asserted in run]

Impact#

When ShortCollateral caps collateral returned on an underwater short, Exchange still burns the full debtRepaying of powerPerp from the liquidator


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.