Reproduced Exploit

Regnum Aurum: liquidations call Curve with the wrong function signature

LiquidationSwap calls get_dy(int128,int128,uint256) and exchange(int128,int128,uint256,uint256). Curve Twocrypto-NG implements get_dy(uint256,uint256,uint256) and exchange(uint256,uint256,uint256,uint256,address). The selectors do not match, so liquidateBorrower reverts before it can clear debt or…

Jun 2025•Ethereum•input-validation•3 min read

Loss

Liquidation reverts. 1000 of debt stays open and 100 of collateral is not seized

Chain

Ethereum

Category

input-validation

Date

Jun 2025

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. 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: 66507-h-06-liquidation-failure-due-to-incorrect-interface-signatur. Standalone Foundry PoC and full write-up: 66507-h-06-liquidation-failure-due-to-incorrect-interface-signatur_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/input-validation/wrong-type · vuln/logic/liquidation-logic

Key info#

FieldValue
LossLiquidation reverts. 1000 of debt stays open and 100 of collateral is not seized
Vulnerable contractLiquidationSwap._swap
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-06
Compilersolc 0.8.27, cancun, via IR
Bug classint128 Curve selector against a uint256 Twocrypto-NG pool

TL;DR#

LiquidationSwap calls get_dy(int128,int128,uint256) and exchange(int128,int128,uint256,uint256). Curve Twocrypto-NG implements get_dy(uint256,uint256,uint256) and exchange(uint256,uint256,uint256,uint256,address). The selectors do not match, so liquidateBorrower reverts before it can clear debt or move collateral. A borrower with 1000 of debt and 100 of collateral cannot be liquidated. The stability pool's seized total stays 0. The same pool, called with the uint256 interface, clears the debt and seizes the 100 collateral.

Background#

Pashov Audit Group's Regnum Aurum review of 26 June 2025, finding H-06. The in-contract ILiquidityPool interface is the older Curve shape. The deployment target is Twocrypto-NG, whose Vyper signatures use uint256 indexes and add a receiver argument to exchange.

The vulnerable code#

SOLIDITY
function _swap(address sender, uint256 amount) internal {
    uint256 expectedDy = liquidityPool.get_dy(1, 0, amount); // @> VULN: int128 selector
    if (expectedDy == 0) revert InvalidExchange();
    uint256 minDy = enableSlippageProtection ? (expectedDy * (10000 - slippageProtectionBps)) / 10000 : 0;
    liquidityPool.exchange(1, 0, amount, minDy);
}

The pool in this reduction only exposes the Twocrypto-NG signatures. get_dy reverts, so exchange is never reached. The debt write sits after _swap and does not run.

The fix is to call get_dy(uint256,uint256,uint256) and exchange(uint256,uint256,uint256,uint256,address).

Root cause#

The call is encoded for a different function than the one deployed at the pool. Every liquidation depends on that call, so every liquidation reverts.

Preconditions#

  • liquidityPool is a Twocrypto-NG pool, not an int128 stableswap.
  • A borrower owes 1000. The liquidation contract holds 100 of their collateral.
  • enableSlippageProtection is true. The value does not matter, because get_dy reverts first.

Attack walkthrough#

  1. The liquidator calls liquidateBorrower for the 1000 debt.
  2. _swap calls get_dy with the int128 selector.
  3. The pool has no such function. The call reverts.
  4. Debt is still 1000. stability.seized is 0. The 100 collateral is still on the liquidation contract.
  5. The control uses the uint256 interface. Debt goes to 0 and the stability pool is credited 100.

Diagrams#

flowchart TD A["Liquidator calls liquidateBorrower"] --> B["VULN get_dy is encoded with int128 indexes"] B --> C["Twocrypto-NG has no matching selector"] C --> D["The call reverts before debt is cleared"] D --> E["1000 debt stays open"] E --> F["Stability pool seizes none of the 100 collateral"]

Impact#

The position cannot be liquidated. The protocol still records 1000 of debt, and the 100 of collateral that should have gone to the stability pool stays where it is. Repeating the call reverts the same way, so underwater debt accumulates for as long as the pool is Twocrypto-NG. The corrected interface liquidates this position in one call.

How to reproduce#

BASH
cd 66507-h-06-liquidation-failure-due-to-incorrect-interface-signatur_exp
forge test -vv

test_exploit_liquidation_reverts_and_debt_remains asserts the revert, the 1000 debt, and a seized total of 0. test_control_uint256_interface_liquidates asserts the debt is cleared and 100 collateral is seized. Output is output.txt.

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.