The Standard

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

Calls to Oracles don't check for stale prices

Summary

Calls to Oracles don't check for stale prices.

Vulnerability Detail

None of the Oracle calls to check for stale prices, for example, LiquidationPool.distributeAssets():

(, int256 priceEurUsd, , , ) = Chainlink
.AggregatorV3Interface(eurUsd)
.latestRoundData();

Impact

Oracle price feeds can become stale due to a variety of reasons. Using a stale price will result in incorrect calculations in most of the key functionality of LiquidationPool & LiquidationPoolManager contracts.

Tool used

Manual Review

Recommendation

Read the updatedAt parameter from the calls to latestRoundData() and verify that it isn't older than a set amount, eg:

(, int256 priceEurUsd, , uint256 updatedAt, ) = Chainlink
.AggregatorV3Interface(eurUsd)
.latestRoundData();
if (updatedAt < block.timestamp - 60 * 60 /* 1 hour */) {
revert("stale price feed");
}
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.