Chainlink's latestRoundData
might return stale or incorrect results
#115
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
invalid
This doesn't seem right
out of scope
Lines of code
https://github.com/code-423n4/2022-08-frax/blob/c4189a3a98b38c8c962c5ea72f1a322fbc2ae45f/src/contracts/FraxlendPairHelper.sol#L125-L149
https://github.com/code-423n4/2022-08-frax/blob/c4189a3a98b38c8c962c5ea72f1a322fbc2ae45f/src/contracts/FraxlendPairCore.sol#L516-L547
Vulnerability details
Impact
Stale data from an oracle will lead to incorrect exchange rates.
Proof of Concept
In
FraxlendPairHelper
andFraxlendPairCore
we are usinglatestRoundData()
to retrieve exchange rate data from a Chainlink oracle but there is no check to ensure that the return value is not stale data. A problem with the oracle (consensus failure, network congestion, etc) could lead to stale return values which would create an incorrect exchange rate.References:
latestRoundData
might return stale or incorrect results 2021-10-mochi-findings#87latestRoundData
might return stale or incorrect results 2021-12-perennial-findings#24Tools Used
Vscode
Recommended Mitigation Steps
Consider adding the following checks:
The text was updated successfully, but these errors were encountered: