QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: low
Invalid

Absence of Validation for Chainlink Oracle's `Min/Max` Price Bounds

Summary

The Chainlink Oracle implementation fails to account for minAnswer and maxAnswer boundaries, potentially allowing the protocol to use incorrect price data during extreme market events.`

Vulnerability Details

The Chainlink Oracle retrieves price data using latestRoundData but does not validate whether the returned price lies within the predefined minAnswer and maxAnswer range. Chainlink feeds may employ these boundaries to ensure price reliability and mitigate the effects of anomalies or extreme market movements.

For example, an aggregator feed may have well-defined minAnswer and maxAnswer values to restrict valid price ranges. However, the current implementation neglects this feature and could inadvertently use a price outside of these bounds.

Consider the following code snippet:
ChainlinkOracle.sol#L27-L33

function _getData() internal view override returns (int216, uint40) {
(, /*uint80 roundID*/ int data, , /*uint startedAt*/ uint timestamp, ) = /*uint80 answeredInRound*/
priceFeed.latestRoundData();
require(data > 0, "INVLDDATA");
data = data * int(10 ** normalizationFactor);
return (int216(data), uint40(timestamp)); // Overflow of data is extremely improbable and uint40 is large enough for timestamps for a very long time
}

Here, the data returned by the oracle is directly used without validating it against the oracle's minAnswer and maxAnswer.

Impact

During extreme market conditions, the protocol may use stale capped prices from Chainlink feeds instead of actual market prices.

Tools Used

Manual Review

Recommendations

Modify the implementation to include a check that validates the returned price against the minAnswer and maxAnswer values. If the price lies outside these bounds, the protocol should handle the anomaly appropriately.

Updates

Lead Judging Commences

n0kto Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

invalid_chainlink_min_max_no_check

LightChaser: ## [Low-25] Chainlink answer is not compared against min/max values

Support

FAQs

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