Router uses stale oracle config after upstream changes
The router caches the oracle configuration and only refreshes it when the oracle address changes or an admin manually flushes the cache. If the upstream oracle changes its configuration in place, the router keeps using stale precision and staleness parameters, which can lead to incorrect health checks and liquidations.
Submitted by v12, also found by qed
Found by V12
contracts/kinetic-router/src/price.rs#L133contracts/kinetic-router/src/storage.rs#L155contracts/kinetic-router/src/storage.rs#L161contracts/price-oracle/src/storage.rs#L116
Targets
- KineticRouterContract::getoracleconfig
- KineticRouterContract::setcachedoracle_config
- KineticRouterContract::flushoracleconfig_cache
- PriceOracleContract::setoracleconfig
Affected Locations
- KineticRouterContract.getoracleconfig: Caches
OracleConfiglocally and reuses it across transactions even when the upstream oracle can change effective settings without changing address. - KineticRouterContract.setcachedoracle_config: Persists the router-side oracle config snapshot, which lets stale precision and staleness parameters survive until an explicit flush.
- KineticRouterContract.flushoracleconfig_cache: Manual cache invalidation is separated into a privileged call instead of being enforced when upstream config changes.
- PriceOracleContract.setoracleconfig: Upstream oracle config can be updated in place, allowing the router cache to drift from the live configuration.
Description
The router caches OracleConfig and keeps serving the cached snapshot from get_oracle_config until the oracle address changes or an admin explicitly calls flush_oracle_config_cache. That assumption is unsafe because the upstream oracle can change configuration in place, including the effective price_precision, without changing its address. As a result, the router can keep using stale precision and staleness parameters in valuation paths such as account-data computation, borrow validation, and liquidation math that derives oracle_to_wad. Those paths compare mis-scaled values against fixed WAD-denominated thresholds like close-factor and leftover-dust limits, so both general health checks and liquidation constraints can be evaluated incorrectly. The issue persists until someone manually synchronizes the router cache, leaving an exploitable desynchronization window after normal oracle administration.
Root Cause
KineticRouterContract.get_oracle_config caches OracleConfig by oracle address even though PriceOracleContract can change the effective configuration, especially price_precision, without changing that address.
Impact
After an upstream oracle or reflector-related config change, users and liquidators can transact while the router is still using outdated scaling assumptions. This can let borrowers over-borrow against overstated collateral or let liquidators seize positions more aggressively than intended, causing wrongful liquidations and bad debt.
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 the router caches the oracle configuration keyed only by oracle address, but the oracle can change its effective configuration (such as price precision) without changing its address.
Impact
After an upstream oracle configuration change, borrowers could over-borrow against overstated collateral or liquidators could seize positions more aggressively than intended, causing wrongful liquidations and bad debt.
What the attacker needed
Upstream oracle config changes in place; router cache not manually flushed
The fix
The router should invalidate or update its cached oracle configuration whenever the upstream oracle's configuration changes, rather than relying on a manual flush.
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 smart contract router stores a copy of the price oracle's settings to save gas. If the oracle's settings are updated without changing its address, the router's copy becomes outdated. This can cause the router to miscalculate collateral values, potentially allowing over-borrowing or wrongful liquidations.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.