The protocol relies on external price feeds to determine the USD value of deposited collateral and to calculate liquidation amounts. Under normal operation, oracle prices are expected to always return valid positive values representing the asset price in USD.
However, the contract does not validate that the oracle price returned from the price feed is strictly greater than zero before casting it from int256 to uint256. If the oracle returns a zero or negative price, the conversion results in either a division-by-zero condition or an extremely large unsigned integer value, leading to incorrect collateral valuation and broken health factor calculations.
This allows users to mint an excessive amount of DSC or causes protocol-wide denial of service during liquidation and accounting operations.
Likelihood:
Chainlink price feeds may legitimately return zero or negative values during oracle failure, migration rounds, sequencer downtime, or invalid reporting rounds.
The system is deployed on zkSync Era, where sequencer interruptions and oracle edge cases are realistic operational scenarios.
Impact:
Negative prices converted to uint256 become extremely large values, artificially inflating collateral valuation and allowing excessive DSC minting.
A zero price causes division-by-zero during liquidation and valuation, resulting in protocol-wide denial of service and frozen liquidations.
The protocol assumes that oracle prices are always positive. However, Chainlink price feeds return signed integers (int256), and under abnormal oracle conditions a round may return a negative or zero price.
Because the returned value is directly cast to uint256 without validation, the system misinterprets invalid oracle data as a valid large positive price.
Validate oracle prices before performing any arithmetic or casting.
Apply the same validation inside _get_token_amount_from_usd.
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.