# Malicious Liquidator Can Liquidate Without Providing Collateral

Cross-chain liquidation on chainB never pulls repayment from liquidator, so a liquidator can seize collateral on chainA while repayment fails on chainB.

- Payout: Audit contest
- Severity: high
- Program: Lend Audit Contest
- Found by: 0x23r0
- Disclosed: 2025-05-22
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-05-lend-audit-contest-judging/issues/636
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-05-lend-audit-contest%3AH-10
- 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 liquidation flow (LayerZero)
**Root cause:** liquidateCrossChain on chainB never transfers/escrows the underlying repayment from the liquidator before sending the seize message to chainA; repayment is attempted only after the seize succeeds, so it can fail while collateral is already seized.
**Steps:**
1. Call `liquidateCrossChain(...)` on chainB with a valid borrower position and repayAmount within close factor.
2. `_validateAndPrepareLiquidation` and `_executeLiquidationCore` compute seizeTokens and `_send` a `CrossChainLiquidationExecute` message to chainA.
3. On chainA the seize succeeds and underlying tokens are transferred to the liquidator.
4. On chainB the repayment pull from the liquidator fails (e.g. no approval / no balance), but the seize already happened.
5. Liquidator keeps seized collateral; liquidatee's debt is not reduced.
**How found:** Code review of the cross-chain liquidation path: noticed `_executeLiquidationCore` sends the seize message before any repayment transfer from the liquidator on chainB, and that repayment only occurs after the seize result returns.
**Exploitation:** Liquidator triggers cross-chain liquidation without holding/approving the repay token on chainB; the seize on chainA executes and delivers underlying to the liquidator, while the chainB repayment step reverts or is skipped, leaving the borrower's debt intact and the protocol short.
**Insight:** In cross-chain flows, check ordering of value transfer vs. message send: any state-changing outbound message that releases value must be preceded by pulling/escrowing the counterparty's funds on the initiating chain, otherwise the remote leg can succeed while the local leg fails.

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

**liquidateCrossChain entrypoint without collateral transfer**

```
function liquidateCrossChain(
        ...
    ) external {
        LendStorage.LiquidationParams memory params = LendStorage.LiquidationParams({
            ...
        });

        _validateAndPrepareLiquidation(params);
        _executeLiquidation(params);
    }
```

**Liquidation core sends seize message without pulling funds**

```
function _executeLiquidationCore(LendStorage.LiquidationParams memory params) private {
        // Calculate seize tokens
        address borrowedlToken = lendStorage.underlyingTolToken(params.borrowedAsset);

        (uint256 amountSeizeError, uint256 seizeTokens) = LendtrollerInterfaceV2(lendtroller)
            .liquidateCalculateSeizeTokens(borrowedlToken, params.lTokenToSeize, params.repayAmount);

        require(amountSeizeError == 0, "Seize calculation failed");

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

