latestRoundData has no check for Round completeness.
Summary
Not validating round completeness from chainlink price feed could lead to using stale or wrong or outdated price and this could lead to fund loss.
Please read: https://docs.chain.link/data-feeds/historical-data
Vulnerability Detail
The getPrice() function in the ChainlinkAdapterOracle.sol file calls the latestRoundData function but do not validate that the answerInRound return value is greater or equals to the roundID return value.
kaysoft
medium
latestRoundData has no check for Round completeness.
Summary
Not validating round completeness from chainlink price feed could lead to using stale or wrong or outdated price and this could lead to fund loss. Please read: https://docs.chain.link/data-feeds/historical-data
Vulnerability Detail
The
getPrice()
function in the ChainlinkAdapterOracle.sol file calls the latestRoundData function but do not validate that theanswerInRound
return value is greater or equals to theroundID
return value.File: https://github.com/sherlock-audit/2023-04-blueberry/blob/main/blueberry-core/contracts/oracle/ChainlinkAdapterOracle.sol#L87-L96
Impact
Not validating round completeness could lead to contract using stale data which could lead to loss of funds.
Code Snippet
https://github.com/sherlock-audit/2023-04-blueberry/blob/main/blueberry-core/contracts/oracle/ChainlinkAdapterOracle.sol#L87-L96
Tool used
Manual Review
Recommendation
Ensure round completeness is also validated with the code below
Duplicate of #118