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.
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:
(, 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
- User supplies 1000 USDC collateral on Chain A (worth $1000, 80% collateral factor = $800 borrowing capacity)
- User borrows 600 USDT on Chain A (leaving $200 remaining capacity)
- User calls
borrowCrossChain()from Chain A → Chain B to borrow 700 USDT - Source chain calculates collateral as $800 and sends this value to Chain B
- Destination chain receives collateral value of $800 and allows borrow of 700 USDT
- Result: User has borrowed $1300 total against $800 collateral capacity (162.5% utilization)
The destination chain validation incorrectly passes because:
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:
- Users can borrow more than their collateral should allow
- Positions become unliquidatable when total borrows exceed collateral value
- Protocol suffers losses when collateral cannot cover outstanding debts
- Multiple users exploiting this can drain protocol reserves
- 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.
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
- Supply collateral on Chain A.
- Borrow some amount on Chain A, reducing remaining capacity.
- Call borrowCrossChain() to borrow on Chain B.
- Source chain sends only the raw collateral value to Chain B.
- 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.