The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: medium
Invalid

Stale Data Feeds

Summary

Additional validation checks should be incorporated for the results obtained from the Chainlink price feed to ensure non-stale data. Given that the price from the data feed directly impacts order execution and liquidations, maintaining up-to-date and accurate data is crucial.

Impact

Utilizing a stale price in the application may lead to incorrect calculations in the contract, creating a vulnerability that could be exploited by malicious actors.

Tools Used

Manual Review

Recommendations

Add the following require statements to validate the price feed:

(, int256 exchangeRate, , uint256 updatedAt , ) = Chainlink
.AggregatorV3Interface(token)
.latestRoundData();
if (exchangeRate <= 0) {
revert Errors.ZeroExchangeRate();
}
if (updatedAt < block.timestamp - 60 * 60 /* 1 hour */) {
revert();
}
Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Chainlink-price

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

Chainlink-price

Support

FAQs

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