Reproduced Exploit

LEND: a cross-chain borrow of 700 ignores 600 of existing debt

borrowCrossChain reads (borrowed, collateral) and forwards only collateral. With borrowed 600 and collateral 800, the destination sees 800 and allows a new 700 borrow. The user owes 1300 against 800 of borrowing power. The destination pool is emptied.

May 2025•Ethereum•logic•3 min read

Loss

Destination lenders pay 700 USDT. Remaining capacity was 200. Total debt becomes 1300 against 800

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: 58375-h-6-cross-chain-borrow-ignores-existing-debt-in-collateral-v. Standalone Foundry PoC and full write-up: 58375-h-6-cross-chain-borrow-ignores-existing-debt-in-collateral-v_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/logic/state-update

Key info#

FieldValue
LossDestination lenders pay 700 USDT. Remaining capacity was 200. Total debt becomes 1300 against 800
Vulnerable contractCrossChainRouter.borrowCrossChain
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-05
Compilersolc 0.8.27, cancun, via IR
Bug classCollateral payload omits existing borrows

TL;DR#

borrowCrossChain reads (borrowed, collateral) and forwards only collateral. With borrowed 600 and collateral 800, the destination sees 800 and allows a new 700 borrow. The user owes 1300 against 800 of borrowing power. The destination pool is emptied.

The vulnerable code#

SOLIDITY
(, uint256 collateral) = lendStorage.getHypotheticalAccountLiquidityCollateral(msg.sender, lToken, 0, 0); // @> VULN: only collateral is kept; the borrowed return value is discarded
require(collateral >= destBorrowed, "Insufficient collateral");

The second line is the destination check quoted in the report. destBorrowed is the new borrow, because the source debt was never sent. The fix is to send collateral - borrowed.

Root cause#

The source message carries raw borrowing power, not remaining capacity. The destination compares that figure to its own new debt only.

Preconditions#

  • Source liquidity is borrowed 600 and collateral 800, matching the report's 1000 collateral at an 80% factor with 600 already borrowed.
  • The destination pool has 700 of cash and no prior debt for this user.
  • The user requests 700.

Attack walkthrough#

  1. Fund the destination with 700.
  2. Call borrowCrossChain(700).
  3. The payload collateral is 800.
  4. The destination check passes and pays 700.
  5. Combined debt is 1300.

Diagrams#

flowchart TD A["Source position borrowed 600 collateral 800"] --> B["VULN payload keeps 800 and drops 600"] B --> C["Destination checks 800 greater than or equal to 700"] C --> D["Pool transfers 700 to the borrower"] D --> E["Total debt 1300 against capacity 800"]

Impact#

The destination pool's 700 USDT is lent to a user who had 200 of room left. Lenders on the destination are undercollateralized by 500 beyond remaining capacity, and by 500 beyond the whole 800 if the source debt is counted too. The position cannot be liquidated back to solvency from the collateral that was declared.

Remediation#

Send collateral - borrowed from the source, and keep the destination check against that remaining capacity.

How to reproduce#

BASH
cd 58375-h-6-cross-chain-borrow-ignores-existing-debt-in-collateral-v_exp
forge test -vv

Captured 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.