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

[M-02] TIMEOUT value is too large

Summary

If we require the most up-to-date prices possible. The difference in minutes can be critical, so three hours is definitely too long a time frame. And it is superior to the Heartbeat proposed by the two selected pairs.

Vulnerability Details

In the OracleLib.sol library inside the staleCheckLatestRoundData() function we can see the condition

if (secondsSince > TIMEOUT) revert OracleLib__StalePrice();

The selected pairs (BTC/USD & ETH/USD) have a Heartbeat Threshold value of 3600 seconds and a proposed TIMEOUT value of 10800 seconds.

That is, it is possible that our function returns a stale price.

Impact

High

Tools Used

Manual code review

Recommendations

Update the TIMEOUT value according to the Heartbeat Threshold value of the pairs, even lower, including the tolerance to guarantee having recent data.

Support

FAQs

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