Engine uses uncapped debt for executed liquidation
The liquidation engine calculates a capped debt amount but forwards the original uncapped amount to the router, allowing a liquidator to split calls within one transaction and exceed the intended close-factor limit. This lets the liquidator seize more collateral and earn extra bonus than the protocol permits, while also making the engine's records inconsistent.
v12 Follow with 0xrex, akshay2796 and 3 others
Originally disclosed on Code4rena
Submitted by v12, also found by 0xrex, akshay2796, CePeni, pepoc, and y4y
Found by V12
contracts/liquidation-engine/src/contract.rs#L49contracts/liquidation-engine/src/contract.rs#L33contracts/kinetic-router/src/router.rs#L295
Targets
- LiquidationEngineContract::execute_liquidation
- KineticRouterContract::liquidation_call
- LiquidationEngineContract::calculate_liquidation
Affected Locations
- LiquidationEngineContract.execute_liquidation: Computes
actual_debt_to_coverand same-transaction close-factor usage, but then forwards the original user input instead of the capped amount. - KineticRouterContract.liquidation_call: Executes the liquidation with the uncapped
debt_to_coverreceived from the engine, so state transition and recorded budget can diverge. - LiquidationEngineContract.calculate_liquidation: Produces the capped
actual_debt_to_coverused for engine-side accounting that never controls the downstream execution amount.
Description
calculate_liquidation computes a capped actual_debt_to_cover and records same-transaction usage through add_user_liquidated_this_tx, but execute_liquidation forwards the original debt_to_cover to kinetic_router.liquidation_call. That makes the engine’s accounting and LiquidationCall record reflect one amount while the router may execute another. Because the router only validates each call in isolation, the engine’s intended cumulative per-transaction close-factor protection is never applied to the real liquidation amount. A liquidator can therefore split calls within one atomic transaction and exceed the intended cap while also leaving inconsistent debt and collateral data in liquidation history. Fixing execute_liquidation to pass and record actual_debt_to_cover consistently resolves both the batch bypass and the accounting mismatch.
Root Cause
execute_liquidation computes a capped actual_debt_to_cover but discards it and calls kinetic_router.liquidation_call with the original debt_to_cover instead.
Impact
A liquidator can atomically repay and seize more debt and collateral than the protocol’s close-factor rules are supposed to permit, capturing extra liquidation bonus from the borrower. The engine’s internal tracking and emitted liquidation records also become unreliable because they no longer match the amount actually executed by the router.
Proof of Concept
See this gist for full Proof of Concept
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
execute_liquidation computes a capped actual_debt_to_cover but discards it and calls kinetic_router.liquidation_call with the original debt_to_cover instead.
Impact
A liquidator can atomically repay and seize more debt and collateral than the close-factor rules permit, capturing extra liquidation bonus, and the engine's tracking and emitted records become unreliable.
What the attacker needed
Liquidator role; atomic transaction with multiple calls
The fix
execute_liquidation should pass and record actual_debt_to_cover consistently instead of the original debt_to_cover.
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.
In a lending protocol, a 'close factor' limits how much of a borrower's debt a liquidator can repay at once, to protect the borrower. Here, the contract worked out the correct limited amount but then sent the original, larger amount to the part that actually moves funds. A liquidator could therefore repay more than allowed in one go and take extra collateral as a reward.
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.