Improper Validation Of Chainlink's latestAnswer
Function
#162
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
Handle
leastwood
Vulnerability details
Impact
The
latestAnswer
function does not allowEIP1271Wallet._validateOrder
to validate the output of the Chainlink oracle query. As a result, it is possible for off-chain orders to use stale results, potentially allowing the taker of the order to extract more value from the treasury.latestRoundData
is able to ensure the round is complete and has returned a valid/expected price by validating additional round data. This is documented here.Proof of Concept
https://github.com/code-423n4/2022-01-notional/blob/main/contracts/utils/EIP1271Wallet.sol#L175-L177
Tools Used
Manual code review.
Chainlink best practices.
Recommended Mitigation Steps
Consider using Chainlink's
latestRoundData
function instead oflatestAnswer
to validate the output correctly. This can be updated to match the following code snippet:The text was updated successfully, but these errors were encountered: