Skip to content
Business logic Audit finding Intermediate

Global pause freezes borrower repayment but not borrow interest, leaving positions immediately liquidatable on unpause

The protocol's global pause blocks repayments and liquidations but does not stop the borrow interest index from accruing, so a borrower's debt keeps growing while they cannot act. On unpause, positions that were healthy at pause time can be immediately liquidatable, with no grace period.

LeoGold Follow with Ephraim, honey-k12 and 5 others

Originally disclosed on Code4rena

Submitted by LeoGold, also found by Ephraim, honey-k12, pepoc, PolarizedLight, SarveshLimaye, TheWeb3Mechanic, and udogodwin

  • contracts/kinetic-router/src/validation.rs #L423-L425
  • contracts/kinetic-router/src/calculation.rs #L469-L488

Background: The asymmetry between the pause mechanism and the interest accrual model

The protocol’s global pause is designed as an emergency circuit breaker. When activated, it prevents users from executing state-changing operations including supply, borrow, repay, and liquidation. The intent is to freeze protocol activity during an incident. However, the critical design flaw is that the pause flag is consulted only at the point of user-initiated transaction entry. The variable borrow index, which determines the real-time debt owed by every borrower, is computed purely from timestamps and the stored borrow rate. No component of the interest accrual path reads is_paused().

This creates a one-sided freeze: borrowers cannot repay, but their debt keeps growing.

The root cause: validate_repay gates on the pause flag while the borrow index does not

validate_repay at validation.rs#L423-L425 is the first thing called for every repayment:

pub fn validate_repay(
    env: &Env,
    _asset: &Address,
    amount: u128,
    rate_mode: u32,
    reserve_data: &k2_shared::ReserveData,
) -> Result<(), KineticRouterError> {
    if storage::is_paused(env) {
        return Err(KineticRouterError::AssetPaused); // ← repay blocked
    }
    ...
}

The liquidation entry points carry the same guard. prepare_liquidation at router.rs#L476-L478 and execute_liquidation at router.rs#L711-L713 both return AssetPaused immediately when the protocol is paused:

if storage::is_paused(&env) {
    return Err(KineticRouterError::AssetPaused);
}

The borrower therefore has no mechanism to act on their position during a pause. They cannot repay debt, add collateral, or trigger a controlled liquidation to preserve some of their position.

Meanwhile, the borrow index accrual at calculation.rs#L469-L488 inside update_state has no is_paused() guard whatsoever:

let cumulated_variable_borrow_interest = calculate_compound_interest(
    env,
    reserve_data.current_variable_borrow_rate,
    reserve_data.last_update_timestamp,
    current_timestamp,     // ← only depends on time, completely ignores pause state
)?;

updated_data.variable_borrow_index = ray_mul(
    env,
    reserve_data.variable_borrow_index,
    cumulated_variable_borrow_interest,
)?;

updated_data.last_update_timestamp = current_timestamp;

The same absence of any pause awareness exists in get_current_variable_borrow_index_with_data at calculation.rs#L1095-L1125, which is the function that computes the debt a user owes at any given moment without writing a new index to storage. Every call to get_user_account_data during the pause will return a growing debt balance as timestamps advance, but the borrower has no transaction path available to respond:

pub fn get_current_variable_borrow_index_with_data(
    env: &Env,
    reserve_data: &ReserveData,
) -> Result<u128, KineticRouterError> {
    let current_timestamp = get_current_timestamp(env);
    ...
    let cumulated_variable_borrow_interest = calculate_compound_interest(
        env,
        reserve_data.current_variable_borrow_rate,
        reserve_data.last_update_timestamp,
        current_timestamp, // ← grows with every passing second, no pause check
    )?;

    ray_mul(
        env,
        reserve_data.variable_borrow_index,
        cumulated_variable_borrow_interest,
    )
}

The compound effect: oracle prices can also move during the pause

The oracle’s set_manual_override function is an admin-level function on a separate contract and is not subject to the router’s pause flag. Real-world market prices also continue moving off-chain and are reflected in Reflector oracle updates that the protocol will read the moment the pause lifts. A borrower who was healthy at pause time can therefore become liquidatable through two simultaneous channels while the pause is active: their denominated debt grows via the borrow index and their collateral value can fall via oracle price discovery. They have no recourse against either.

No grace period on unpause

unpause at emergency.rs#L16-L21 flips the pause flag to false and returns immediately:

pub fn unpause(env: Env, caller: Address) -> Result<(), KineticRouterError> {
    storage::validate_admin(&env, &caller)?;
    caller.require_auth();
    storage::set_paused(&env, false); // ← flag flipped, execution returns immediately
    Ok(())
}

There is no grace window, no repayment-only period, and no minimum delay before liquidation becomes available again. The moment the pool admin calls unpause, all liquidation entry points become active against positions that may have crossed the health factor boundary entirely during the pause period when the borrower was unable to take any defensive action.

Impact

A borrower who held a position with a health factor above 1.0 at the moment of pause is exposed to losing their collateral in a liquidation they could not have prevented. Depending on the duration of the pause and the borrow rate at the time, the health factor degradation may be significant. In a scenario involving a prolonged pause of several days at a meaningful borrow rate, a position that was fully healthy at the start of the pause could emerge from it well below the liquidation threshold and be immediately seized by liquidation bots that were monitoring the pause state. The borrower’s only recourse would have been to repay before the pause, which they had no way of anticipating in time for an emergency pause.

Proof of Concept

See original finding for full Proof of Concept


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

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

The pause flag is checked only in user-facing entry points such as repay and liquidation, while the interest accrual path computes the borrow index purely from timestamps and never consults the pause state.

Impact

A borrower healthy at pause time could see their health factor fall below the liquidation threshold during a prolonged pause and be liquidated immediately on unpause, with no grace period to repay.

What the attacker needed

Protocol admin triggers global pause; borrower has an open borrow position; pause lasts long enough for debt to grow

The fix

Interest accrual should be frozen while paused, or unpause should open a repayment-only grace window before liquidations are re-enabled.

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 lending protocol lets people borrow assets against collateral and repay over time with interest. A 'pause' is an emergency switch meant to stop activity, but here it stops borrowers from repaying while interest keeps ticking up, so their debt grows and their safety margin shrinks. When the pause is lifted, they can be liquidated (their collateral sold off) before they get a chance to repay.

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 LeoGold

View all

1 more disclosed report, best first.

More from K2

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.