Steadefi

Steadefi
DeFiHardhatFoundryOracle
35,000 USDC
View results
Submission Details
Severity: medium
Invalid

Not checked stale ChainLink price

Summary

ChainlinkOracle#_badChainlinkResponse is not checked stale ChainLink price.

Vulnerability Details

function _badChainlinkResponse(ChainlinkResponse memory response) internal view returns (bool) {
// Check for response call reverted
if (!response.success) { return true; }
// Check for an invalid roundId that is 0
if (response.roundId == 0) { return true; }
// Check for an invalid timeStamp that is 0, or in the future
if (response.timestamp == 0 || response.timestamp > block.timestamp) { return true; }
// Check for non-positive price
if (response.answer == 0) { return true; }
return false;
}

as we can see, ths function not checked the returned ChainLink price is stale or not.

Impact

Protocol may use a stale ChainLink price.

Tools Used

vscode, Manual Review

Recommendations

Change if (response.timestamp == 0 || response.timestamp > block.timestamp) { return true; } to if (response.timestamp == 0 || response.timestamp > block.timestamp || max_delay_time < block.timestamp - response.timestamp) { return true; }

Updates

Lead Judging Commences

hans Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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