Reorgs could revert the setRange function and lead to a long lasting stale price of USDY #411
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-495
low quality report
This report is of especially low quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/rwaOracles/RWADynamicOracle.sol#L158
Vulnerability details
Summary
Reorgs could revert the setRange function and therefore lead to stale prices for a long time (depending on the off chain protection, against it)
Vulnerability Details
Here is the setRange function of the USDY price oracle:
As we can see, the function will revert if lastRange.end >= endTimestamp. Depending on the time the setter calls this function and the duration of these ranges, a reorg could potentially lead to a revert of this function and if this is not recognized directly and could potentially lead to a long lasting stale price.
Impact
Long lasting stale price of the USDY price oracle, which could lead to a variety of problems
Tools Used
Manual Review
Recommendations
Use a duration instead of a fixed timestamp inside setRange, so that there is no need to check if lastRange.end > endTimestamp, because it will just set lastRange.end + duration as the next endTimestamp.
Assessed type
Oracle
The text was updated successfully, but these errors were encountered: