# Cross-chain liquidation uses incorrect lToken address, preventing repayment and breaking liquidation flow

Cross-chain liquidation on Chain B looks up the borrow position using Chain A's lToken address, so findCrossChainCollateral fails and repayment never applies.

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

**Target:** CrossChainRouter.sol cross-chain liquidation handler (LayerZero)
**Root cause:** _executeLiquidationCore converts lTokenToSeize to its Chain A version before sending, but _handleLiquidationSuccess on Chain B reuses that Chain A destlToken to look up the borrow position, which only exists under Chain B's lToken address.
**Steps:**
1. Borrower has cross-chain borrow: collateral on Chain A, debt on Chain B.
2. Liquidator calls liquidation on Chain B; _executeLiquidationCore sends seize message to Chain A with `crossChainLTokenMap(params.lTokenToSeize, params.srcEid)` (Chain A lToken).
3. Chain A seizes collateral and returns success payload with `destlToken` = Chain A lToken.
4. Chain B `_handleLiquidationSuccess` calls `lTokenToUnderlying(payload.destlToken)` and `findCrossChainCollateral(...)` with the Chain A address.
5. Lookup fails since crossChainCollaterals on Chain B is keyed by Chain B lToken; repayment is skipped.
6. Fix: use `payload.srcToken` / `underlyingTolToken(payload.srcToken)` and pass srcEid/currentEid correctly.
**How found:** Code review of the cross-chain liquidation message round-trip: noticed the outbound seize message deliberately maps to the Chain A lToken, then observed the success handler reuses that same destlToken for a Chain B storage lookup.
**Exploitation:** No attacker capital needed; any valid liquidation triggers the broken flow. Collateral is seized on Chain A but debt on Chain B is never reduced, leaving borrower position active and liquidator receiving seized tokens without debt repayment.
**Insight:** In cross-chain message round-trips, audit every field for which chain's address space it belongs to; a token address translated for the destination chain must be re-translated (or the original srcToken used) when the reply is processed back on the source chain.

## Proof of concept (copied exactly from the original report)

**Liquidation success handler using wrong destlToken**

```
function _handleLiquidationSuccess(LZPayload memory payload) private {
    // Find the borrow position on Chain B to get the correct srcEid
445    address underlying = lendStorage.lTokenToUnderlying(payload.destlToken);

    // Find the specific collateral record
    (bool found, uint256 index) = lendStorage.findCrossChainCollateral(
        payload.sender,
        underlying,
        currentEid, // srcEid is current chain
        0, // We don't know destEid yet, but we can match on other fields
        payload.destlToken,
        payload.srcToken
    );
```

**Seize send translating lToken to Chain A**

```
function _executeLiquidationCore(LendStorage.LiquidationParams memory params) private {
    ...
    // Send message to Chain A to execute the seize
    _send(
        params.srcEid,
        seizeTokens,
        params.storedBorrowIndex,
        0,
        params.borrower,
280     lendStorage.crossChainLTokenMap(params.lTokenToSeize, params.srcEid), // Convert to Chain A version before sending
        msg.sender,
        params.borrowedAsset,
        ContractType.CrossChainLiquidationExecute
    );
}
```

