Skip to content
Business logic Audit finding Intermediate

If CoreRouter is liquidated, some user may suffer more loss than expected

The CoreRouter contract calculates the underlying tokens a user receives when redeeming based on a fixed exchange rate, ignoring that CoreRouter itself can be liquidated and have less collateral. If CoreRouter is liquidated, early redeemers can withdraw fully while later users suffer greater losses than expected.

0xgh0st Follow with h2134, jokr and 3 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-05-lend-audit-contest-judging/issues/824

Found by

0xgh0st, h2134, jokr, t.aksoy, xiaoming90, zxriptor

Summary

If CoreRouter is liquidated, some users may suffer more loss than expected.

Root Cause

When a user redeem tokens from CoreRouter, the underlying token amount to be received is calculated as user amount * exchange rate.

CoreRouter.sol#L117-L118):

Solidity
        // Calculate expected underlying tokens
        uint256 expectedUnderlying = (_amount * exchangeRateBefore) / 1e18;

The problem is that CoreRouter acts as both a supplier and borrower to LToken, therefore it's possible that CoreRouter is liquidated in LToken if its collateral is less than borrowed amount.

If CoreRouter is liquidated, it will have less collateral in LToken than before, however, such situation is not took into consideration when user s redeem, as a result, the users who redeem earlier can fully redeem, leaving the last users suffer the loss.

Internal Pre-conditions

NA

External Pre-conditions

CoreRouter is liquidated in LToken.

Attack Path

NA

Impact

User suffer more loss than expected.

PoC

No response

Mitigation

When user redeems, the received amount should be calculated based on CoreRouter's collateral in LToken.

The original report as published on Sherlock, by 0xgh0st. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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 redemption calculation uses a fixed exchange rate without accounting for a potential liquidation of CoreRouter that reduces its collateral.

Impact

Users who redeem later may suffer more loss than expected because earlier redeemers can fully redeem, leaving less collateral for the rest.

What the attacker needed

CoreRouter is liquidated in LToken

The fix

The received amount should be calculated based on CoreRouter's actual collateral in LToken when a user redeems.

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.

A smart contract called CoreRouter holds funds for many users and also borrows and lends on another contract. If CoreRouter gets liquidated (forced to repay a debt because its collateral fell too low), it ends up with less money than before. The bug is that when users withdraw, the contract still pays them as if nothing was lost, so the first people to withdraw get everything and the last ones lose out.

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.

More by 0xgh0st

View all

2 more disclosed reports, best first.

More from LEND

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.