Configured health-factor threshold is ignored in key paths
The contract stores a configurable health-factor liquidation threshold, but several liquidation and collateral-management paths still compare against a hardcoded value of 1.0. When governance sets a non-1.0 threshold, liquidators can seize collateral from positions that should be healthy, or users can become stuck in inconsistent states.
v12 Follow with 0xBeastBoy, AvantGard and 9 others
Originally disclosed on Code4rena
Submitted by v12, also found by 0xBeastBoy, AvantGard, ChainSentry, coinsspor, fellows, hezze, mickeyjoe, qed, samuraii77, SarveshLimaye, and twicek
Found by V12
contracts/shared/src/utils.rs#L276contracts/kinetic-router/src/router.rs#L463contracts/kinetic-router/src/router.rs#L700contracts/kinetic-router/src/router.rs#L336contracts/kinetic-router/src/validation.rs#L160contracts/kinetic-router/src/validation.rs#L228contracts/kinetic-router/src/router.rs#L295contracts/kinetic-router/src/router.rs#L1256contracts/kinetic-router/src/calculation.rs#L585
Targets
- KineticRouter::is_liquidatable
- KineticRouterContract::prepare_liquidation
- KineticRouterContract::execute_liquidation
- KineticRouterContract::sethfliquidation_threshold
- KineticRouterContract::validateusercan_borrow
- KineticRouterContract::validateusercan_withdraw
- KineticRouterContract::liquidation_call
- KineticRouterContract::setuserusereserveas_coll
- KineticRouterContract::validateswaphealth_factor
Affected Locations
- KineticRouter.is_liquidatable: This helper hardcodes liquidation eligibility instead of consuming the configured threshold.
- KineticRouterContract.prepare_liquidation: Liquidation preparation still compares health factor against
WAD, not the stored parameter. - KineticRouterContract.execute_liquidation: The liquidation execution path continues enforcing the hardcoded
1.0cutoff. - KineticRouterContract.sethfliquidation_threshold: Stores the configurable liquidation threshold that should act as the single source of truth for health-factor enforcement.
- KineticRouterContract.validateusercan_borrow: Borrow validation reads the stored liquidation threshold, showing the intended invariant for post-action health factors.
- KineticRouterContract.validateusercan_withdraw: Withdraw validation also uses the configured threshold, which diverges from hardcoded checks elsewhere.
- KineticRouterContract.liquidation_call: The externally reachable liquidation entry uses
WADas the liquidation boundary, enabling mismatched liquidations. - KineticRouterContract.setuserusereserveas_coll: Collateral-toggle logic hardcodes
1.0e18, extending the threshold mismatch beyond liquidation itself. - KineticRouterContract.validateswaphealth_factor: Swap health-factor validation is another path that keeps using the hardcoded boundary.
Description
set_hf_liquidation_threshold stores a configurable health-factor boundary, and validate_user_can_borrow plus validate_user_can_withdraw enforce that stored value. However, liquidation-related and other health-factor-sensitive paths still compare against hardcoded WAD or HEALTH_FACTOR_LIQUIDATION_THRESHOLD instead of reading get_health_factor_liquidation_threshold, including is_liquidatable, prepare_liquidation, execute_liquidation, liquidation_call, set_user_use_reserve_as_coll, and validate_swap_health_factor. This creates two incompatible protocol rules whenever governance selects a supported non-1.0 threshold. If the threshold is lowered below 1.0, positions that the router explicitly permits can still be liquidated immediately under the hardcoded rule. If the threshold is raised above 1.0, some flows keep enforcing only 1.0, which leads to inconsistent blocking, bypass of the intended safety buffer, or users becoming stuck between incompatible checks.
Root Cause
set_hf_liquidation_threshold writes a configurable threshold, but several liquidation and collateral-management paths still compare health factor to hardcoded WAD or HEALTH_FACTOR_LIQUIDATION_THRESHOLD instead of consistently reading get_health_factor_liquidation_threshold.
Impact
When the configured threshold is below 1.0, liquidators can seize collateral and collect liquidation bonuses from borrowers whose positions should still be considered healthy under the configured risk model. When the threshold is above 1.0, users can remain in or move into states that some paths reject and others allow until health factor falls below 1.0, increasing bad-debt exposure and creating inconsistent or stuck user behavior.
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
Likely, several functions compare the health factor to a hardcoded constant instead of reading the stored configurable threshold.
Impact
When the threshold is below 1.0, liquidators can seize collateral and collect bonuses from positions that should be healthy; when above 1.0, users can become stuck or bad debt can increase.
What the attacker needed
Governance sets a non-1.0 threshold
The fix
The code should consistently read the stored threshold via `get_health_factor_liquidation_threshold` in all health-factor-sensitive paths.
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 health factor is a number that shows how safe a loan is; below 1.0 it can be liquidated. The contract lets an admin change the liquidation cutoff, but some parts of the code ignore that setting and always use 1.0. This means the rules disagree, so a borrower could be liquidated too early or get stuck.
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.