Incorrect srcToken Used When Cross-Chain Liquidation
In the cross-chain liquidation flow, the destination chain's borrowed token address is passed back and used as the source chain's borrowed token when locating the borrower's collateral record. Because token addresses can differ across chains, the lookup can fail and the repayment step can revert after collateral has already been seized, leaving the debt unchanged.
aman Follow with future and rudhra1749
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-05-lend-audit-contest-judging/issues/720
Found by
aman, future, rudhra1749
Summary
The cross-chain borrow flow is as follow:
- On Chain A (source chain), calculate the collateral value and send it.
- On Chain B (destination chain), borrow the asset and register it to
crossChainCollateral. - On Chain A, register the debt to
crossChainBorrow.
During this process, the underlying token of the source chain and the lToken of the destination chain are used for srcToken and dstlToken of crossChainCollateral and crossChainBorrow.
The cross-chain liquidation flow is as follow:
- Initiation on Chain B.
- Seizure on Chain A (the source chain).
- Repayment on Chain B (the destination chain), or handle failure.
- Matching(DestRepay) on Chain A.
Root Cause
In Cross-Chain Liquidation Flow Step 3, during the identification of crossChainCollaterals, the srcToken field incorrectly uses the destination chain's borrowed token instead of the source chain's borrowed token.
Internal pre-conditions
N/A
External pre-conditions
N/A
Attack Path
N/A
PoC
function _send(
uint32 _dstEid,
uint256 _amount,
uint256 _borrowIndex,
uint256 _collateral,
address _sender,
address _destlToken,
address _liquidator,
address _srcToken,
ContractType ctype
) ...
We can confirm that crossChainCollaterals.srcToken represents the underlying token on the source chain, while crossChainCollaterals.borrowedlToken corresponds to the lToken on the destination chain.
Borrow Step 1, on Chain A: https://github.com/sherlock-audit/2025-05-lend-audit-contest/blob/main/Lend-V2/src/LayerZero/CrossChainRouter.sol#L151
function borrowCrossChain(uint256 _amount, address _borrowToken, uint32 _destEid) external payable {
...
address destLToken = lendStorage.underlyingToDestlToken(_borrowToken, _destEid);
...
_send(
_destEid,
_amount,
0, // Initial borrowIndex, will be set on dest chain
collateral,
msg.sender,
destLToken,
address(0), // liquidator
151: _borrowToken,
ContractType.BorrowCrossChain
);
}
The _borrowToken is underlying token of chainA.
Borrow Step 2, on Chain B: https://github.com/sherlock-audit/2025-05-lend-audit-contest/blob/main/Lend-V2/src/LayerZero/CrossChainRouter.sol#L650
function _handleBorrowCrossChainRequest(LZPayload memory payload, uint32 srcEid) private {
...{
lendStorage.addCrossChainCollateral(
payload.sender,
destUnderlying,
LendStorage.Borrow({
srcEid: srcEid,
destEid: currentEid,
principle: payload.amount,
borrowIndex: currentBorrowIndex,
borrowedlToken: payload.destlToken,
650: srcToken: payload.srcToken
})
);
}...
}
The payload.srcToken(srcToken of CrossChainCollateral) is underlying token of chainA.
Liquidation Step 1, on Chain B: https://github.com/sherlock-audit/2025-05-lend-audit-contest/blob/main/Lend-V2/src/LayerZero/CrossChainRouter.sol#L282
function _executeLiquidationCore(LendStorage.LiquidationParams memory params) private {
// Calculate seize tokens
address borrowedlToken = lendStorage.underlyingTolToken(params.borrowedAsset);
...
_send(
params.srcEid,
seizeTokens,
params.storedBorrowIndex,
0,
params.borrower,
lendStorage.crossChainLTokenMap(params.lTokenToSeize, params.srcEid), // Convert to Chain A version before sending
msg.sender,
282: params.borrowedAsset,
ContractType.CrossChainLiquidationExecute
);
}
Here, params.borrowedAsset is the underlying borrowed token on Chain B.
Liquidation Step 2, on Chain A: https://github.com/sherlock-audit/2025-05-lend-audit-contest/blob/main/Lend-V2/src/LayerZero/CrossChainRouter.sol#L363
function _handleLiquidationExecute(LZPayload memory payload, uint32 srcEid) private {
...
_send(
srcEid,
payload.amount,
0,
0,
payload.sender,
payload.destlToken,
payload.liquidator,
363: payload.srcToken,
ContractType.LiquidationSuccess
);
}
In this step, the payload.srcToken(above the borrowedAsset) is sent again to Chain B.
Liquidation Step 3, on Chain B: https://github.com/sherlock-audit/2025-05-lend-audit-contest/blob/main/Lend-V2/src/LayerZero/CrossChainRouter.sol#L453
function _handleLiquidationSuccess(LZPayload memory payload) private {
// Find the borrow position on Chain B to get the correct srcEid
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
453: payload.destlToken,
454: payload.srcToken
);
require(found, "Borrow position not found");
LendStorage.Borrow[] memory userCollaterals = lendStorage.getCrossChainCollaterals(payload.sender, underlying);
uint32 srcEid = uint32(userCollaterals[index].srcEid);
// Now that we know the borrow position and srcEid, we can repay the borrow using the escrowed tokens
// repayCrossChainBorrowInternal will handle updating state and distributing rewards.
repayCrossChainBorrowInternal(
payload.sender, // The borrower
payload.liquidator, // The liquidator (repayer)
payload.amount, // Amount to repay
payload.destlToken, // lToken representing the borrowed asset on this chain
srcEid // The chain where the collateral (and borrow reference) is tracked
);
}
Here, payload.srcToken, which is the destination chain(chainB)'s borrowed token, is incorrectly used as the source chain's borrowed token.
Even if the asset is the same (e.g., USDC), the address on each chain could be different.
This could lead to failures in finding the borrow position and potentially cause the liquidation to revert.
Even if the seize operation is successful on Chain A, the repayment could fail on Chain B. This means that while the liquidatee's collateral is seized, the liquidatee's debt remains unchanged. This is loss of liquidatee and the protocol could also suffer losses due to under-water positions.
Impact
- Loss of users' funds.
- Protocol's financial loss.
Mitigation
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
Likely the liquidation-success handler reuses the destination chain's borrowed token as the source chain's token when matching the stored collateral record, so the lookup key does not match the record created at borrow time.
Impact
Collateral could be seized while the borrower's debt remains unchanged, causing loss to the user and potentially to the protocol through under-water positions.
What the attacker needed
Cross-chain borrow position exists; liquidation triggered on destination chain
How it was found
- Initiate the cross-chain liquidation on the destination chain.
- Seize the collateral on the source chain.
- On the destination chain, handle the liquidation success by looking up the collateral record using the wrong token address.
- The lookup fails or the repayment reverts, so the debt is not repaid.
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.
This protocol lets people borrow assets on one blockchain using collateral held on another. When a borrower is liquidated, the system takes their collateral on one chain and repays their debt on the other. The code mixed up which chain's token address it was using, so the second half of the liquidation could fail after the collateral was already taken, leaving the borrower out of pocket and the debt still open.
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.