The OracleModule::_getOnchainPrice() and KeeperFee::getKeeperFee() uses Chainlink's latestRoundData() to get the latest price. However, there is no check if the return value indicates stale data.
According to Chainlink's documentation, this function does not error if no answer has been reached but returns 0 or outdated round data. The external Chainlink oracle, which provides index price information to the system, introduces risk inherent to any dependency on third-party data sources.
Impact
The OracleModule::_getOnchainPrice() and KeeperFee::getKeeperFee() could return stale price data for the underlying asset.
0xblackskull
medium
Chainlink's
latestRoundData()
might return stale or incorrect resultsSummary
Chainlink's latestRoundData() is used but there is no check if the return value indicates stale data. This could lead to stale prices according to the Chainlink documentation: https://docs.chain.link/docs/historical-price-data/#historical-rounds
Vulnerability Detail
The
OracleModule::_getOnchainPrice()
andKeeperFee::getKeeperFee()
uses Chainlink's latestRoundData() to get the latest price. However, there is no check if the return value indicates stale data.According to Chainlink's documentation, this function does not error if no answer has been reached but returns 0 or outdated round data. The external Chainlink oracle, which provides index price information to the system, introduces risk inherent to any dependency on third-party data sources.
Impact
The
OracleModule::_getOnchainPrice()
andKeeperFee::getKeeperFee()
could return stale price data for the underlying asset.Code Snippet
https://github.com/sherlock-audit/2023-12-flatmoney/blob/main/flatcoin-v1/src/OracleModule.sol#L145
https://github.com/sherlock-audit/2023-12-flatmoney/blob/main/flatcoin-v1/src/misc/KeeperFee.sol#L84
Tool used
Manual Review
Recommendation
Duplicate of #3