oracle_lib._stale_check_latest_round_data() converts the Chainlink price (int256) to uint256 without verifying that price > 0 or checking against aggregator minAnswer/maxAnswer boundaries.
If a price feed reports a zero or negative value, downstream calculations divide by zero or underflow, causing unexpected reverts in all valuation functions.
During extreme market volatility where price reaches the aggregator circuit breaker limits, the protocol continues trading at pegged limit prices.
In oracle_lib.vy, the returned price is checked for staleness, but its numeric value is never validated:
In dsc_engine.vy, _get_token_amount_from_usd uses this price as the denominator:
If price <= 0, convert(price, uint256) either triggers a runtime error or division by zero, preventing liquidations. Furthermore, if a market crash drops an asset's real price below Chainlink's minAnswer, the aggregator continues reporting minAnswer, causing the protocol to overvalue collateral during black swan events.
Likelihood: Low
Occurs during severe market flash-crashes or oracle misconfigurations where price bounds are reached or non-positive values are emitted.
Impact: High
Division by zero freezes liquidation capabilities during market crashes; circuit-breaker caps cause collateral overvaluation and unbacked debt minting.
Severity: Medium
If an aggregator returns price = 0:
Calling get_token_amount_from_usd() causes integer division by zero: (usd_amount_in_wei * PRECISION) // 0.
Liquidators cannot liquidate positions, leading to protocol bad debt.
Add explicit checks ensuring price > 0 and verify that the reported price does not match the aggregator's minAnswer or maxAnswer circuit-breaker boundaries:
Explanation: Reverting on non-positive or bounded prices protects downstream calculations from division by zero and prevents overvalued collateral execution during extreme market events.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.