15,000 USDC
View results
Submission Details
Severity: medium

Oracle could return a stale or incorrect result

Summary

Oracle could return a stale or incorrect result

Vulnerability Details

function getUsdValue(address token, uint256 amount) public view returns (uint256) {
AggregatorV3Interface priceFeed = AggregatorV3Interface(s_priceFeeds[token]);
(, int256 price,,,) = priceFeed.staleCheckLatestRoundData();
// 1 ETH = $1000
// The returned value from CL will be 1000 * 1e8
return ((uint256(price) * ADDITIONAL_FEED_PRECISION) * amount) / PRECISION;
}

oracle return data could be stale

Impact

get incorrect price from oracle

Tools Used

manual

Recommendations

add max_delay param to limit get price time

Support

FAQs

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