The _stale_check_latest_round_data function in oracle_lib.vy validates updated_at, answered_in_round, and freshness timestamp to ensure Chainlink oracle data is not stale.
However, the function completely omits validating that the returned price is strictly positive (price > 0). Chainlink's latestRoundData() returns an int256 price. In anomalous market conditions or feed halts, oracles can report zero or negative values. If price == 0, _get_usd_value treats all user collateral as having $0 value (triggering immediate wrongful liquidation of healthy accounts), while _get_token_amount_from_usd divides by zero and reverts, completely bricking the liquidation mechanism.
Likelihood:
Can occur during extreme market crashes (e.g. flash crashes similar to LUNA/UST or negative commodity asset spikes) or oracle feed malfunctions.
Impact:
Medium. A zero price report drops all user health factors to zero (wrongful liquidation cascade) and causes a revert on division by zero during liquidation execution.
When Chainlink returns a price of 0, _get_usd_value returns 0 collateral value, and _get_token_amount_from_usd reverts with zero division error when calculating liquidation amounts.
Add an explicit assertion in oracle_lib verifying that the returned Chainlink price is strictly greater than zero.
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.