ACL membership checks ignore entries after the first 64
The router's ACL membership checks only examine the first 64 entries of any whitelist or blacklist, while the setters store unbounded lists. An attacker placed in the tail of a blacklist can continue using reserve operations and liquidation paths, and legitimate addresses in the tail of a whitelist are wrongly denied access.
Submitted by v12, also found by 0xsh, Bughacker, coinsspor, curiux, DemoreX, goto, lostOpcode, Mpengele, qed, t4sk, TheWeb3Mechanic, and usmanatique
Found by V12
contracts/kinetic-router/src/storage.rs#L813contracts/kinetic-router/src/storage.rs#L873contracts/kinetic-router/src/storage.rs#L759contracts/kinetic-router/src/storage.rs#L933contracts/kinetic-router/src/storage.rs#L829contracts/kinetic-router/src/storage.rs#L889contracts/kinetic-router/src/storage.rs#L770contracts/kinetic-router/src/storage.rs#L946contracts/kinetic-router/src/storage.rs#L1001contracts/a-token/src/contract.rs#L722contracts/kinetic-router/src/validation.rs#L37contracts/kinetic-router/src/validation.rs#L51contracts/kinetic-router/src/validation.rs#L24contracts/kinetic-router/src/operations.rs#L11contracts/kinetic-router/src/operations.rs#L132contracts/kinetic-router/src/operations.rs#L285contracts/kinetic-router/src/operations.rs#L450contracts/kinetic-router/src/router.rs#L415contracts/kinetic-router/src/swap.rs#L38contracts/kinetic-router/src/liquidation.rs#L102contracts/kinetic-router/src/router.rs#L463contracts/kinetic-router/src/router.rs#L700contracts/kinetic-router/src/storage.rs#L858contracts/kinetic-router/src/storage.rs#L745
Targets
- KineticRouterContract::setreservewhitelist
- KineticRouterContract::setreserveblacklist
- KineticRouterContract::setliquidationwhitelist
- KineticRouterContract::setliquidationblacklist
- KineticRouterContract::isaddresswhitelistedforreserve
- KineticRouterContract::isaddressblacklistedforreserve
- KineticRouterContract::isaddresswhitelistedforliquidation
- KineticRouterContract::isaddressblacklistedforliquidation
- KineticRouterContract::isswaphandler_whitelisted
- ATokenContract::validatenotblacklisted
- KineticRouterContract::validatereserveblacklist_access
- KineticRouterContract::validateliquidationblacklist_access
- KineticRouterContract::validateliquidationwhitelist_access
- KineticRouterContract::supply
- KineticRouterContract::withdraw
- KineticRouterContract::borrow
- KineticRouterContract::repay
- KineticRouterContract::flash_loan
- KineticRouterContract::swap_collateral
- KineticRouterContract::liquidation_call
- KineticRouterContract::prepare_liquidation
- KineticRouterContract::execute_liquidation
- KineticRouterContract::getreserveblacklist
- KineticRouterContract::getliquidationwhitelist
Affected Locations
- KineticRouterContract.setreservewhitelist: Admin setter persists an arbitrary reserve allowlist without enforcing the same bound used by later membership checks.
- KineticRouterContract.setreserveblacklist: Admin setter persists an arbitrary reserve denylist without enforcing the same bound used by later membership checks.
- KineticRouterContract.setliquidationwhitelist: Admin setter persists an arbitrary liquidation allowlist without enforcing the same bound used by later membership checks.
- KineticRouterContract.setliquidationblacklist: Admin setter persists an arbitrary liquidation denylist without enforcing the same bound used by later membership checks.
- KineticRouterContract.isaddresswhitelistedforreserve: Reserve whitelist membership is evaluated with
list.len().min(MAX_RESERVES), so only the first 64 configured addresses are honored. - KineticRouterContract.isaddressblacklistedforreserve: Reserve blacklist membership is evaluated with
list.len().min(MAX_RESERVES), so blacklist entries after slot 63 are ignored. - KineticRouterContract.isaddresswhitelistedforliquidation: Liquidation whitelist membership is evaluated with
list.len().min(MAX_RESERVES), so approved liquidators after slot 63 are treated as unwhitelisted. - KineticRouterContract.isaddressblacklistedforliquidation: Liquidation blacklist membership is evaluated with
list.len().min(MAX_RESERVES), so blacklisted liquidators after slot 63 are ignored. - KineticRouterContract.isswaphandler_whitelisted: Swap-handler whitelist uses the same
MAX_RESERVES-bounded scan pattern, so handlers after slot 63 are never recognized. - ATokenContract.validatenotblacklisted:
aTokentransfer/approval enforcement delegates to the router blacklist check, so the reserve blacklist truncation reaches token-level restrictions. - KineticRouterContract.validatereserveblacklist_access: Reserve access validation consumes the truncated reserve blacklist result and propagates the bypass into reserve-facing flows.
- KineticRouterContract.validateliquidationblacklist_access: Liquidation denylist validation consumes the truncated liquidation blacklist result and propagates the bypass into liquidation flows.
- KineticRouterContract.validateliquidationwhitelist_access: Liquidation allowlist validation consumes the truncated liquidation whitelist result and propagates false denials into liquidation flows.
- KineticRouterContract.supply: User-facing reserve entrypoint relies on ACL helpers that ignore addresses after the first 64 positions.
- KineticRouterContract.withdraw: User-facing reserve entrypoint relies on ACL helpers that ignore addresses after the first 64 positions.
- KineticRouterContract.borrow: User-facing reserve entrypoint relies on ACL helpers that ignore addresses after the first 64 positions.
- KineticRouterContract.repay: User-facing reserve entrypoint relies on ACL helpers that ignore addresses after the first 64 positions.
- KineticRouterContract.flash_loan: Flash-loan flow depends on reserve ACL checks that only honor the first 64 configured addresses.
- KineticRouterContract.swap_collateral: Swap flow depends on reserve ACL or handler ACL checks that only honor the first 64 configured addresses.
- KineticRouterContract.liquidation_call: Liquidation entrypoint depends on truncated liquidation whitelist/blacklist checks.
- KineticRouterContract.prepare_liquidation: Two-step liquidation path depends on truncated liquidation whitelist/blacklist checks.
- KineticRouterContract.execute_liquidation: Two-step liquidation path depends on truncated liquidation whitelist/blacklist checks.
- KineticRouterContract.getreserveblacklist: Getter returns the full stored reserve blacklist, which can make operators believe tail entries are enforced when runtime checks ignore them.
- KineticRouterContract.getliquidationwhitelist: Getter loads the full stored liquidation whitelist even though only the first 64 entries are enforced.
Description
The router stores reserve and liquidation ACLs as arbitrary Vec<Address> values, but the corresponding membership checks stop at list.len().min(MAX_RESERVES). Because MAX_RESERVES is the 64-reserve protocol limit rather than an ACL size limit, only the first 64 entries of reserve whitelists, reserve blacklists, liquidation whitelists, liquidation blacklists, and the swap-handler whitelist are ever enforced. This creates a write/read mismatch where setters and getters accept or expose the full list while runtime validation silently ignores every address after slot 63. Tail entries in blacklists therefore bypass validate_reserve_blacklist_access or validate_liquidation_blacklist_access, while tail entries in whitelists fail the corresponding allowlist checks even though they were configured correctly. Since these helpers are reused across router operations and aToken blacklist enforcement, the bug affects real state-changing flows rather than only view functions.
Root Cause
ACL membership checks reuse MAX_RESERVES as the iteration bound while the corresponding setters store unbounded Vec<Address> lists, so only the first 64 configured addresses are ever enforced.
Impact
Once an operator configures an ACL with more than 64 addresses, accounts placed in the tail of a blacklist can keep using reserve operations or liquidation paths, including supply, borrow, withdraw, repay, flash-loan, swap, and aToken-gated actions for the affected reserve. At the same time, legitimate addresses placed in the tail of a whitelist are denied reserve access or liquidation rights, which can reduce keeper participation and leave unhealthy positions unresolved longer.
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
ACL membership checks reuse MAX_RESERVES as the iteration bound while the corresponding setters store unbounded Vec<Address> lists, so only the first 64 configured addresses are ever enforced.
Impact
Accounts in the tail of a blacklist can keep using reserve operations or liquidation paths, including supply, borrow, withdraw, repay, flash-loan, swap, and aToken-gated actions, while legitimate addresses in the tail of a whitelist are denied access, which could reduce keeper participation and leave unhealthy positions unresolved longer.
What the attacker needed
Operator configures ACL with more than 64 addresses
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 whitelist or blacklist is a list of addresses that are allowed or blocked. The code that checks membership only looks at the first 64 entries, but the code that saves the list accepts any number. So if an operator adds a 65th address to a blacklist, that address is never actually blocked.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.