Factory reserve tokens cannot be upgraded through the intended path
Factory-deployed reserve tokens are assigned the configurator contract as their upgrade admin, but the documented upgrade path routes the call through the router, which does not satisfy that admin check. As a result, governance cannot reliably upgrade these tokens through the intended workflow.
v12 Follow with ahahaHard1k, Brene and 10 others
Originally disclosed on Code4rena
Submitted by v12, also found by ahahaHard1k, Brene, gzeon, hezze, Izaz_Mahmud, Ledger_Patrol, luckyidiot, oxwhite, Smtilkss, t4sk, tech_bro, and Tigerfrake
Found by V12
contracts/pool-configurator/src/reserve.rs#L720contracts/pool-configurator/src/reserve.rs#L663contracts/pool-configurator/src/reserve.rs#L631contracts/kinetic-router/src/reserve.rs#L381
Targets
- PoolConfiguratorContract::deployandinit_reserve
- KineticRouter::updatetokenimplementation
- PoolConfiguratorContract::updatevariabledebt_token
- PoolConfiguratorContract::update_atoken
Affected Locations
- PoolConfiguratorContract.deployandinit_reserve:
deploy_and_init_reserveinitializes factory-deployed reserve tokens withadmin = configurator_address, making the configurator contract the party that must satisfy future tokenupgrade()auth checks. - KineticRouter.updatetokenimplementation:
update_token_implementationperforms the finaltoken.upgrade(...)call, so it is where the missing nested authorization and caller mismatch materialize. - PoolConfiguratorContract.updatevariabledebt_token:
update_variable_debt_tokenonly covers the first hop into the router and does not prepare authorization for the downstream tokenupgrade()call that still expects the configurator contract as admin. - PoolConfiguratorContract.update_atoken: The advertised aToken maintenance path is part of the same router-mediated upgrade flow that is inconsistent with the deployment-time admin assignment.
Description
The reserve-token upgrade flow is internally inconsistent between deployment-time admin assignment and the later maintenance path. deploy_and_init_reserve stores configurator_address as the upgrade admin for factory-deployed tokens, so future upgrade() calls must authenticate as the PoolConfigurator contract itself. However, the documented upgrade path sends the action through the router, and update_variable_debt_token only authenticates the first hop instead of the nested KineticRouter -> token.upgrade(...) subcall. The same flow also uses a caller model that does not line up with router-side validation, so even reaching the final token-admin check can fail early. As a result, factory-deployed reserve tokens are effectively not upgradeable through the intended admin path unless the upgrade flow is redesigned to match the stored admin model.
Root Cause
The system assigns factory-deployed token admin rights to PoolConfiguratorContract but its router-mediated upgrade path neither uses that contract as the effective caller nor authorizes the nested token upgrade() invocation accordingly.
Impact
Governance cannot reliably apply hotfixes or implementation upgrades to factory-deployed aTokens and debt tokens through the published configurator workflow. If a token-side bug is discovered, the protocol may have to operate with the vulnerable implementation until broader contract changes are shipped.
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
The deployment step makes the configurator contract the token admin, but the router-mediated upgrade path neither calls as that contract nor authorises the nested upgrade call.
Impact
Governance may be unable to apply hotfixes or implementation upgrades to factory-deployed aTokens and debt tokens through the published workflow, potentially leaving a vulnerable implementation in place.
What the attacker needed
Governance upgrade action; factory-deployed reserve token
The fix
The upgrade flow should be redesigned so the effective caller and nested authorisation match the stored admin model.
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.
Some tokens can be replaced with a newer version, but only by an account the token trusts as its admin. Here the token trusts the configurator contract, yet the upgrade is sent through a different contract (the router), so the token rejects it. The result is that the team cannot easily fix or improve those tokens later.
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.