Skip to content
Business logic Audit finding Intermediate

Cross-chain borrow ignores existing debt in collateral validation

The cross-chain borrow function sends only the raw collateral value to the destination chain, ignoring existing borrows on the source chain. An attacker could borrow against the same collateral on multiple chains, exceeding their borrowing capacity and leaving the protocol undercollateralised.

0xEkko Follow with 0xgh0st, JeRRy0422 and 20 others

Originally disclosed on Sherlock

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

Found by

0xEkko, 0xgh0st, JeRRy0422, Kirkeelee, Nlwje, Phaethon, TessKimy, Uddercover, Waydou, Z3R0, aman, dystopia, ggg_ttt_hhh, hgrano, jokr, mahdifa, mussucal, newspacexyz, oxelmiguel, stonejiajia, t.aksoy, theweb3mechanic, zxriptor

Summary

When initiating cross-chain borrows, the source chain only sends the raw collateral value to the destination chain without accounting for existing borrows. This allows users to effectively double-spend their collateral by borrowing against the same collateral on multiple chains, creating systemic undercollateralization risks.

Root Cause

In borrowCrossChain(), the collateral calculation only extracts the collateral amount while ignoring existing borrows:

Solidity
(, uint256 collateral) = 
    lendStorage.getHypotheticalAccountLiquidityCollateral(msg.sender, LToken(_lToken), 0, 0);

The function getHypotheticalAccountLiquidityCollateral returns (totalBorrowed, totalCollateral), but only the collateral value is sent to the destination chain via LayerZero message. The destination chain then validates only against this raw collateral value without knowing about existing borrows.

Internal Pre-conditions

None

External Pre-conditions

None

Attack Path

  1. User supplies 1000 USDC collateral on Chain A (worth $1000, 80% collateral factor = $800 borrowing capacity)
  2. User borrows 600 USDT on Chain A (leaving $200 remaining capacity)
  3. User calls borrowCrossChain() from Chain A → Chain B to borrow 700 USDT
  4. Source chain calculates collateral as $800 and sends this value to Chain B
  5. Destination chain receives collateral value of $800 and allows borrow of 700 USDT
  6. Result: User has borrowed $1300 total against $800 collateral capacity (162.5% utilization)

The destination chain validation incorrectly passes because:

Solidity
require(payload.collateral >= totalBorrowed, "Insufficient collateral");

Where payload.collateral is the raw $800 collateral value, not the available borrowing capacity after existing borrows.

Impact

High - Systemic undercollateralization with potential for protocol insolvency:

  1. Users can borrow more than their collateral should allow
  2. Positions become unliquidatable when total borrows exceed collateral value
  3. Protocol suffers losses when collateral cannot cover outstanding debts
  4. Multiple users exploiting this can drain protocol reserves
  5. Makes risk assessment and recovery mechanisms more difficult

Example with 1000 USDC collateral (80% factor):

  • Available capacity: $800
  • Source chain borrows: $600
  • Cross-chain borrow: $700
  • Total exposure: $1300 vs $800 capacity (162.5% utilization)

PoC

No response

Mitigation

Send net available borrowing capacity instead of raw collateral value. The source chain should calculate the difference between total collateral and existing borrows, then send this available capacity to the destination chain for validation rather than the raw collateral amount.

The original report as published on Sherlock, by 0xEkko. 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 source chain sends only the total collateral amount to the destination chain, omitting the existing borrowed amount, so the destination chain validates against gross collateral rather than net available capacity.

Impact

Users could borrow more than their collateral should allow, leading to systemic undercollateralisation and potential protocol insolvency.

What the attacker needed

Collateral supplied on source chain; existing borrow on source chain; cross-chain borrow function available

The fix

The source chain should send the net available borrowing capacity (total collateral minus existing borrows) to the destination chain for validation, instead of the raw collateral value.

How it was found

  1. Supply collateral on Chain A.
  2. Borrow some amount on Chain A, reducing remaining capacity.
  3. Call borrowCrossChain() to borrow on Chain B.
  4. Source chain sends only the raw collateral value to Chain B.
  5. Destination chain validates the borrow against this raw collateral value and allows it.

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.

When you borrow money using collateral, the system should check how much you have already borrowed. Here, the system only looked at the total collateral value and forgot to subtract existing loans, so a user could borrow again on another chain as if they had no debt. This could let someone borrow more than their collateral is worth, risking losses for the lending platform.

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 by 0xEkko

View all

10 more disclosed reports, best first.

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.