Steadefi

Steadefi
DeFiHardhatFoundryOracle
35,000 USDC
View results
Submission Details
Severity: low
Valid

Chainlink oracle will return the wrong price if the aggregator hits minAnswer

Summary

ChainlinkAdapterOracle should check the returned answer against the minPrice/maxPrice and revert if the answer is outside of the bounds:

Vulnerability Details

Chainlink aggregators have a built-in circuit breaker if the price of an asset goes outside of a predetermined price band.
The result is that if an asset experiences a huge drop in value (i.e. price crashes) the price of the oracle will continue to return the minPrice instead of the actual price of the asset and vice versa maxPrice.

No checks being done if minPrice or maxPrice is being returned;

Impact

Tools Used

Manual Analysis, Chainlink Docs, Previous audit reports

Recommendations

Consider checking price is not minAnswer or maxAnswer

(uint80, int256 answer, uint, uint, uint80) = oracle.latestRoundData();
if (answer >= maxPrice or answer <= minPrice) revert();
Updates

Lead Judging Commences

hans Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

Chainlink oracle minAnswer check

Impact: Medium Likelihood: Low

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.