Skip to content
Business logic Audit finding Advanced

User can evade liquidation and bridge funds by exploiting cross-chain borrow/collateral invariant

A user can populate both cross-chain borrow and collateral mappings for the same asset on both chains by supplying collateral on one chain and borrowing on the other, then doing the reverse with dust amounts. This causes the borrowWithInterest function to revert, preventing liquidation and allowing the user to bridge out nearly all collateral.

Emine Follow with Kirkeelee, PNS and 8 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-05-lend-audit-contest-judging/issues/224

Found by

Emine, Kirkeelee, PNS, Waydou, Z3R0, h2134, jokr, mahdifa, oxelmiguel, patitonar, zxriptor

Summary

A user can supply nearly all their collateral on Chain A and borrow against it on Chain B, then supply a dust amount on Chain B and borrow a dust amount on Chain A. This sequence results in both cross-chain borrow and collateral mappings being populated for the same asset and user on both chains, violating protocol invariant. As a result, the protocol cannot calculate or liquidate the user’s position, because the function borrowWithInterest reverts, allowing the user to bridge out nearly all their collateral and evade liquidation.

Root Cause

The protocol enforces an invariant in the borrowWithInterest(address borrower, address _lToken) function that, for any user and underlying asset on a given chain, only one of crossChainBorrows or crossChainCollaterals should be populated. However, if a user first supplies collateral on Chain A and borrows on Chain B (populating crossChainBorrows on A and crossChainCollaterals on B), and then supplies a dust amount on Chain B and borrows a dust amount on Chain A (populating crossChainBorrows on B and crossChainCollaterals on A), both mappings become populated for the same user and asset on both chains. This breaks the protocol’s invariant, causing the require statement in borrowWithInterest to revert. As a result, any function that checks or calculates borrow balances (including liquidation logic) will fail for that user and asset. The user loses out on LEND rewards for the position but is able to bridge out almost all their collateral, leaving the protocol unable to liquidate or close their position.

https://github.com/sherlock-audit/2025-05-lend-audit-contest/blob/main/Lend-V2/src/LayerZero/LendStorage.sol#L478-L486

Internal Pre-conditions

The protocol allows users to open cross-chain borrows in both directions for the same asset.

External Pre-conditions

The user can supply a dust (very small) amount on one chain and borrow a dust amount on the other, in addition to their main position.

Attack Path

  1. User supplies almost all collateral on Chain A.
  2. User borrows nearly the full amount on Chain B (cross-chain borrow).
  3. User supplies a dust amount on Chain B.
  4. User borrows a dust amount on Chain A (reverse cross-chain borrow).
  5. Now, both crossChainBorrows and crossChainCollaterals are populated for the same asset and user on both chains.
  6. Any liquidation or borrow calculation reverts due to the require in borrowWithInterest, making the position uncloseable and non-liquidatable.
  7. User loses out on LEND rewards for the position but successfully bridges out almost all their collateral.

Impact

The protocol cannot calculate or liquidate the user’s position, as borrowWithInterest reverts. The user can bridge out nearly all their collateral, leaving the protocol with an uncloseable, non-liquidatable position. This results in bad debt accumulation: the protocol is left with outstanding borrows that cannot be repaid or liquidated, directly threatening solvency and leading to potential loss of funds for other users and the protocol itself.

PoC

No response

Mitigation

Redesign the cross-chain borrow/collateral tracking logic to prevent both mappings from being populated for the same user and asset on the same chain.

The original report as published on Sherlock, by Emine. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The protocol does not prevent both crossChainBorrows and crossChainCollaterals from being populated for the same user and asset on the same chain, violating an invariant enforced in borrowWithInterest.

Impact

The protocol cannot calculate or liquidate the user's position, allowing the user to bridge out nearly all collateral and leaving bad debt that threatens solvency.

What the attacker needed

Cross-chain borrows allowed both ways; user can supply dust on one chain; user can borrow dust on the other chain

The fix

Redesign the cross-chain borrow/collateral tracking logic to prevent both mappings from being populated for the same user and asset on the same chain.

How it was found

  1. User supplies almost all collateral on Chain A.
  2. User borrows nearly the full amount on Chain B (cross-chain borrow).
  3. User supplies a dust amount on Chain B.
  4. User borrows a dust amount on Chain A (reverse cross-chain borrow).
  5. Both crossChainBorrows and crossChainCollaterals become populated for the same asset and user on both chains.
  6. Any liquidation or borrow calculation reverts due to the require in borrowWithInterest, making the position uncloseable and non-liquidatable.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

In a cross-chain lending protocol, a user can borrow on one blockchain using collateral on another. The protocol expects that for any given asset, a user is either a borrower or a collateral provider on a specific chain, not both. By making tiny transactions in both directions, the user breaks this expectation, and the protocol's safety check fails, so it cannot liquidate the user's position.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More from LEND

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.