The LibOracle::oracleCircuitBreaker()
lacks checking the condition: "block.timestamp > 2 hours + baseTimeStamp
". Hence, the function will not be able to verify whether or not the baseChainlinkPrice
is stale (2-hour stale heartbeat).
This report raises an issue regarding the lack of stale price check for the base oracle (ETH/USD price) in the
oracleCircuitBreaker()
only, as the 2-hour stale check and the lack of stale price check for the non-USD asset oracle were flagged as known issues.
The oracleCircuitBreaker()
lacks checking the condition: "block.timestamp > 2 hours + baseTimeStamp
" when compared to the baseOracleCircuitBreaker()
.
Without the check of the condition: "block.timestamp > 2 hours + baseTimeStamp
", the oracleCircuitBreaker()
will not be able to verify whether or not the baseChainlinkPrice
is stale (2-hour stale heartbeat).
For this reason, the oracleCircuitBreaker()
will not revert the transaction as expected if the baseChainlinkPrice
is stale.
The oracleCircuitBreaker() lacks checking the condition: "block.timestamp > 2 hours + baseTimeStamp"
: https://github.com/Cyfrin/2023-09-ditto/blob/a93b4276420a092913f43169a353a6198d3c21b9/contracts/libraries/LibOracle.sol#L120-L123
Whereas the baseOracleCircuitBreaker() checks that condition
: https://github.com/Cyfrin/2023-09-ditto/blob/a93b4276420a092913f43169a353a6198d3c21b9/contracts/libraries/LibOracle.sol#L73
This report raises an issue regarding the lack of stale price check for the base oracle (ETH/USD price) in the
oracleCircuitBreaker()
only, as the 2-hour stale check and the lack of stale price check for the non-USD asset oracle were flagged as known issues.
The oracleCircuitBreaker()
lacks checking the condition: "block.timestamp > 2 hours + baseTimeStamp
". Hence, the function will not be able to verify whether or not the baseChainlinkPrice
is stale (2-hour stale heartbeat).
Consequently, the oracleCircuitBreaker()
will not revert the transaction as expected if the baseChainlinkPrice
is stale. The stale price will be consumed by core functions of the protocol, leading to harming the funds of the protocol and its users.
Manual Review
Add the condition: "block.timestamp > 2 hours + baseTimeStamp
" in the oracleCircuitBreaker()
to provide the stale check.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.