Missing check for delayed oracle price #341
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
Lines of code
https://github.com/code-423n4/2022-09-y2k-finance/blob/2175c044af98509261e4147edeb48e1036773771/src/Controller.sol#L288-L309
Vulnerability details
Impact
Missing check for delayed oracle price. If oracle bug by not starting next round (answeredInRound >= roundID but timeStamp is 1 hour to the past), the oracle returns a stale price.
Proof of Concept
Not checked for
block.timestamp <= updatedAt + stalePriceDelay
-> a stale price caseTools Used
Manual review
Recommended Mitigation Steps
Add
block.timestamp <= updatedAt + stalePriceDelay
check. Where stalePriceDelay is a constantThe text was updated successfully, but these errors were encountered: