# Cross-chain borrow ignores existing debt in collateral validation

Cross-chain borrow sends raw collateral instead of net borrowing capacity, letting users borrow against the same collateral on multiple chains and exceed capacity.

- Payout: Audit contest
- Severity: high
- Program: Lend Audit Contest
- Found by: 0xEkko
- Disclosed: 2025-05-22
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-05-lend-audit-contest-judging/issues/341
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-05-lend-audit-contest%3AH-6
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:chained technique:source-review vuln:accounting-error vuln:business-logic

**Target:** CrossChainRouter.sol cross-chain borrow validation (LayerZero)
**Root cause:** borrowCrossChain() calls getHypotheticalAccountLiquidityCollateral and forwards only the collateral value, discarding totalBorrowed, so the destination chain validates against raw collateral rather than available capacity after existing debt.
**Steps:**
1. Supply 1000 USDC on Chain A (80% factor = $800 capacity)
2. Borrow 600 USDT on Chain A, leaving $200 capacity
3. Call `borrowCrossChain()` from Chain A to Chain B for 700 USDT
4. Source chain sends collateral=$800 (ignores $600 debt) to Chain B
5. Chain B check `require(payload.collateral >= totalBorrowed)` passes with $800 >= $700
6. Total exposure $1300 vs $800 capacity
**How found:** Code review of borrowCrossChain() noticed the tuple return of getHypotheticalAccountLiquidityCollateral discards totalBorrowed, and the destination-side require compares against raw payload.collateral.
**Exploitation:** Attacker borrows up to near-full collateral value on the source chain, then initiates a cross-chain borrow sized against the same raw collateral on the destination chain, doubling exposure and leaving positions undercollateralized/possibly unliquidatable.
**Escalation:** Repeat across multiple destination chains to multiply exposure against a single collateral deposit.
**Insight:** When a value crosses a trust boundary (e.g. LayerZero message), audit what the sender computes vs what the receiver assumes; here the sender had debt data but only forwarded collateral, so the receiver's invariant was weaker than the sender's.

