Reproduced Exploit

LEND: cross-chain liquidation books the seize as the repay

A cross-chain liquidation tells the collateral chain how many collateral tokens to seize. That amount is correct on the way out. On the way back, _handleLiquidationExecute sends the same payload.amount and _handleLiquidationSuccess passes it to repayCrossChainBorrowInternal as the repay. The liquid…

May 2025•Ethereum•logic•3 min read

Loss

Borrower debt falls by 150 while only 100 was repaid. Lenders are short 50

Chain

Ethereum

Category

logic

Date

May 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: 58388-h-19-cross-chain-liquidation-uses-collateral-seize-amount-in. Standalone Foundry PoC and full write-up: 58388-h-19-cross-chain-liquidation-uses-collateral-seize-amount-in_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/logic/liquidation-logic · vuln/bridge/missing-validation

Key info#

FieldValue
LossBorrower debt falls by 150 while only 100 was repaid. Lenders are short 50
Vulnerable contractCrossChainRouter._handleLiquidationExecute
Attacker EOA0x1111111111111111111111111111111111111111 (the liquidator)
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-05
Compilersolc 0.8.27, cancun, via IR
Bug classThe return LayerZero payload reuses the seize amount as the debt repay

TL;DR#

A cross-chain liquidation tells the collateral chain how many collateral tokens to seize. That amount is correct on the way out. On the way back, _handleLiquidationExecute sends the same payload.amount and _handleLiquidationSuccess passes it to repayCrossChainBorrowInternal as the repay. The liquidator paid 100. Debt is reduced by the 150 seize. The borrower owes 50 less than the cash that came in. This run does not mint a profit token. The gap is the debt accounting.

The vulnerable code#

SOLIDITY
collateral.transfer(liquidator, liquidatorShare);
_send(amount, LIQUIDATION_SUCCESS, repayAmount); // @> VULN: success payload reuses the seize amount

repayAmount is still in scope. The return message should carry it:

DIFF
- _send(amount, LIQUIDATION_SUCCESS, repayAmount);
+ _send(repayAmount, LIQUIDATION_SUCCESS, repayAmount);

Root cause#

One Payload.amount field is used for two different quantities. _executeLiquidationCore correctly puts seizeTokens in it for the collateral chain. _handleLiquidationExecute then forwards that field unchanged, and the debt chain treats it as the repayment. The two numbers differ whenever the liquidation incentive is not 1.

Preconditions#

  • The borrower owes 200 on the debt chain and has collateral on the other chain.
  • The liquidator repays 100. The comptroller's seize for that repay is 150.
  • Protocol seize share is 10 percent, so the liquidator receives 135 collateral. That premium is intended. The bug is the extra 50 of debt that is erased.

Attack walkthrough#

  1. The router pulls 100 debt tokens from the liquidator. cashIn is 100.
  2. The execute message carries 150, the seize. The collateral leg keeps a 15 protocol share and pays the liquidator 135.
  3. The success message sends 150, not the 100 repay.
  4. repayCrossChainBorrowInternal subtracts 150 from the 200 debt. Debt left is 50. It should be 100.
  5. debtReducedBy - cashIn is 50.

Diagrams#

flowchart TD A["Liquidator repays 100"] --> B["Seize is calculated as 150 collateral"] B --> C["Collateral chain seizes 150 and pays the liquidator 135"] C --> D["VULN the return message sends 150 instead of the 100 repay"] D --> E["Debt falls by 150"] E --> F["Lenders are short 50"]

Impact#

Lenders' books drop by 50 more than the cash the liquidation brought in. The borrower owes 50 instead of 100. The liquidator's 135 collateral is the normal 10 percent protocol share taken out of a 150 seize, not the accounting gap. Repeat the liquidation and the gap scales with the difference between seize and repay.

How to reproduce#

BASH
cd 58388-h-19-cross-chain-liquidation-uses-collateral-seize-amount-in_exp
forge test -vv

test_debt_falls_by_the_seize_not_the_repay asserts cash in is 100, debt reduced is 150, debt left is 50, and the gap is 50.

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.