Root Cause: The _stale_check_latest_round_data function in oracle_lib.vy returns price data without validating that the price is positive. The dsc_engine.vy then converts this int256 price directly to uint256 without any checks.
Impact: If Chainlink returns zero, division by zero occurs in _get_token_amount_from_usd() causing all liquidations to revert. If Chainlink returns a negative price, the conversion to uint256 produces an astronomically large number, allowing attackers to mint unlimited DSC with minimal collateral, leading to complete protocol insolvency.
Normal Behavior: The oracle library fetches price data from Chainlink and returns it to the DSC Engine for collateral valuation. The price should always be a positive value representing the USD price of the collateral token.
Issue: The _stale_check_latest_round_data function in oracle_lib.vy returns the price as int256 without validating that it is positive. The dsc_engine.vy then converts this directly to uint256 without validation. Chainlink oracles can return zero or negative prices during failure modes, leading to division by zero or integer underflow.
Likelihood:HIGH
Reason 1: Chainlink oracles have historically returned zero prices during network congestion or oracle failures (e.g., YFI/ETH on November 19, 2020)
Reason 2: During extreme market volatility or flash crashes, price feeds may temporarily report invalid data
Impact:HIGH
Impact 1:If price = 0: Division by zero in _get_token_amount_from_usd() causes all liquidations to revert, freezing the protocol
Impact 2:If price < 0: Conversion to uint256 results in an astronomically large number, allowing attackers to mint unlimited DSC with minimal collateral
When Chainlink returns price = 0, the _get_token_amount_from_usd() function attempts to divide by zero, causing all liquidation transactions to revert. When Chainlink returns price = -1, converting to uint256 yields max_value(uint256), making 1 wei of collateral appear infinitely valuable, allowing an attacker to mint billions of DSC with dust collateral.
Add a validation check to ensure the oracle price is positive before returning the data. This single assertion prevents both zero and negative price scenarios from propagating through the system.
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.