15,000 USDC
View results
Submission Details
Severity: medium
Valid

Chainlink price not properly checked

Summary

ChainLink price not fully checked

Vulnerability Details

Ad it stand from the code only the staleness of the data is checked ,which in most cases in not enough. Many scenarios involve where the feed is active and refreshing, but the data it provides is not of best quality. Example is when Luna hit it's min threshold of 0.10$, ChainLink continued to provide fresh, but inaccurate data.

Impact

Prices can hit the min/max threshold and still be fresh, tho not accurate.

Tools Used

Manual review

Recommendations

To address this issue, it is important to include a simple check to verify the data

function staleCheckLatestRoundData() external view override returns (uint256) {
(uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) = priceFeed.latestRoundData();
+ if(answeredInRound < roundId) revert StalePrice();
+ if(price <= 0) revert ZeroPrice();
+ if(minPrice >= price => maxPrice) revert MinMaxPriceReached();
...

Support

FAQs

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