Oracle validation should reject non-positive prices because a zero or negative USD price is not a valid collateral price.
oracle_lib._stale_check_latest_round_data checks freshness fields but never checks price > 0. A fresh round with price == 0 passes the oracle library and later causes division by zero in _get_token_amount_from_usd. A negative price can also revert during convert(price, uint256).
Likelihood:
This occurs when a price feed returns a fresh round with a zero or negative answer.
The mock contracts already support updating the answer to 0, demonstrating that the engine accepts the feed shape until the arithmetic path fails.
Impact:
Liquidation and price conversion can revert due to division by zero or failed int-to-uint conversion.
Unhealthy positions for the affected collateral can become temporarily non-liquidatable.
Reject zero and negative oracle answers directly in the oracle library before any conversion or division uses the price.
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.