Closed sherlock-admin closed 1 year ago
The proposed change does not improve the security. In the case that answeredInRound > roundId
something may have gone wrong with the oracle, and we would want to revert. Reverting unless roundId == answeredInRound
prevents that issue.
martin
medium
Insufficient oracle data validation
Summary
Missing oracle data feed validation check
Vulnerability Detail
Missing oracle data feed validation check
Impact
Each time the oracle updates the price feed, it generates a new roundId. The roundId should match the timestamp of the price data, which can also be obtained from oracle's smart contract. The roundIds should be in sequential order with no missing values.
Code Snippet
https://github.com/sherlock-audit/2023-02-bond/blob/main/bonds/src/BondChainlinkOracle.sol#L135
Tool used
Manual Review
Recommendation
Add the following check and keep reverting if true.