Inactive collateral remains counted for new borrowing while liquidation and withdrawal reject the same reserve as AssetNotActive
After a reserve is deactivated, the account-data calculation still counts its balance as collateral for new borrowing, while withdrawal and liquidation reject the same reserve as inactive. A user can therefore borrow an active asset against deactivated collateral that cannot later be liquidated or withdrawn through the normal paths.
abdelhaq16 Follow with 0xCiphky, 0xDemon and 10 others
Originally disclosed on Code4rena
Submitted by abdelhaq16, also found by 0xCiphky, 0xDemon, ChainSentry, derkomai, elaprendiz1927, fuzious, gwumex, Lamsy, qed, rubencrxz, TheSpark, and yinziping
contracts/pool-configurator/src/reserve.rs#L242-L274contracts/kinetic-router/src/reserve.rs#L330-L346contracts/kinetic-router/src/calculation.rs#L127-L164contracts/kinetic-router/src/calculation.rs#L224-L309contracts/kinetic-router/src/operations.rs#L309-L330contracts/kinetic-router/src/validation.rs#L160-L221contracts/kinetic-router/src/validation.rs#L93-L116contracts/kinetic-router/src/validation.rs#L517-L522
set_reserve_active(false) is a normal reserve lifecycle action exposed through the PoolConfigurator. It updates the reserve’s active permission truth in ReserveData.configuration.
The documented reserve lifecycle describes active=false as a wind-down / deprecation state: new supplies and new borrows are blocked, while withdrawals, repays, and liquidations remain allowed. The issue is not that an admin can deactivate a reserve. The issue is that, after deactivation, the protocol applies the active flag inconsistently: account-data still treats the inactive reserve as valid collateral for new borrowing, while withdrawal and liquidation reject that same reserve as inactive.
As a result, a user can borrow an active asset using collateral from a reserve that has already been marked inactive. Once the debt exists, the same inactive collateral cannot be seized through direct liquidation and cannot be withdrawn through the normal withdrawal path because both consumers revert with AssetNotActive.
The protocol therefore treats the same reserve under incompatible truths:
- account-data / borrow: the inactive reserve is valid collateral and provides borrow capacity;
- liquidation / withdraw: the same reserve is inactive and cannot be used for liquidation or withdrawal.
This can leave the protocol with debt backed by collateral that account-data still counts for new borrowing, but liquidation refuses to seize through the normal direct liquidation path.
Root Cause
The root cause is inconsistent consumption of the reserve active flag across account-data, borrowing, withdrawal, and liquidation consumers.
The PoolConfigurator can mark a reserve inactive by loading the current ReserveData.configuration, calling configuration.set_active(active), and forwarding the updated configuration to the router. The router then replaces reserve_data.configuration and stores it. This does not clear user collateral bits, does not reject deactivation of a collateralized reserve, and does not make account-data ignore inactive reserves.
The account-data calculation iterates over reserves selected by the user’s bitmap. If user_config.is_using_as_collateral(reserve_id) is true, it fetches the reserve and later adds the aToken balance into total_collateral_base, weighted liquidation threshold, and weighted LTV. There is no reserve_data.configuration.is_active() check before the collateral contribution is counted.
The borrow path validates the borrowed reserve itself, then calls validate_user_can_borrow, which calculates user account data and checks the requested borrow against available_borrows_base. When the borrowed reserve is a different active reserve, this validation does not reject the inactive collateral reserve contributing to account-data. Since inactive collateral is still included in account-data, the borrow succeeds.
By contrast, withdraw and liquidation validate the active flag at their final effectful consumers. Withdraw rejects the target reserve if it is inactive, and liquidation rejects either the collateral or debt reserve if inactive. This makes the inactive collateral usable for borrow capacity but unusable for liquidation and withdrawal.
Attack Path
- A user supplies
asset_aand enables it as collateral. - The normal PoolConfigurator/admin lifecycle path calls
set_reserve_active(asset_a, false). - The user’s
asset_acollateral bit remains set inUserConfiguration. get_user_account_dataand the borrow validation account-data calculation still include the inactiveasset_abalance intotal_collateral_baseandavailable_borrows_base.- The user borrows active
asset_busing the inactiveasset_acollateral. - After the position becomes liquidatable, a liquidator tries to liquidate the user using
asset_aas collateral. - Direct liquidation fails with
AssetNotActivebecause the liquidation consumer rejects inactive collateral reserves. - The user also cannot withdraw
asset_a, because withdraw rejects inactive reserves withAssetNotActive.
This is not a malicious-admin scenario. The admin action is a normal reserve lifecycle action. The vulnerability is that the protocol’s consumers do not agree on the meaning of active=false after that action. The PoC does not borrow the inactive reserve itself; it borrows a separate active asset using the inactive reserve as collateral.
Impact
This can create protocol solvency and availability risk:
- users can create new debt in active assets using collateral from a reserve that has already been deactivated;
- unhealthy positions whose relevant collateral is the inactive reserve cannot be liquidated through the direct liquidation path because the collateral reserve is rejected as inactive;
- users cannot withdraw the same inactive collateral either, blocking the normal collateral-exit path;
- the protocol can be left with debt backed by collateral that account-data still counts but liquidation refuses to seize.
This is distinct from a simple exit-path liveness issue. The PoC first proves that deactivated collateral still provides new borrow capacity and is actually used to mint debt and transfer an active borrowed asset out of the reserve. The later AssetNotActive failures demonstrate that the same collateral truth cannot be enforced by liquidation or withdrawal once the debt exists.
The issue is stronger than a harmless revert because the borrow is already allowed before the revert surfaces in liquidation/withdrawal. It is also not user-error-only and not direct trusted-admin misuse: the admin is not stealing funds or choosing an arbitrary harmful parameter; a normal lifecycle transition leaves downstream consumers on incompatible active-flag truths.
Proof of Concept
See original finding 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
The reserve active flag is consumed inconsistently: account-data and borrow validation never check it before counting collateral, while withdraw and liquidation reject inactive reserves at their final effectful consumers.
Impact
Users can create new debt in active assets using deactivated collateral, and unhealthy positions whose collateral is that inactive reserve cannot be liquidated or withdrawn through the normal paths, leaving the protocol with debt it may not be able to seize.
What the attacker needed
A user has supplied and enabled collateral; admin deactivates that reserve; user borrows a different active asset
The fix
The protocol should apply the active flag consistently, for example by excluding inactive reserves from account-data collateral or by rejecting deactivation of a reserve that is still used as collateral.
How it was found
- A user supplies an asset and enables it as collateral.
- The admin deactivates that reserve through the normal lifecycle path.
- The user's collateral bit for the inactive reserve remains set.
- Account-data still counts the inactive collateral, so the user borrows a different active asset.
- A liquidator tries to seize the inactive collateral and gets AssetNotActive.
- The user also cannot withdraw the inactive collateral because withdraw rejects it as inactive.
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 deposit one asset as security (collateral) and borrow another against it. An admin can mark a reserve as inactive to wind it down, meaning no new deposits or borrows of that asset. The bug is that the borrowing check still counts the inactive asset as security, but the liquidation and withdrawal checks refuse to touch it, so a borrower can create debt backed by collateral that the protocol will not let anyone seize or return.
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.