Chainlink's latestRoundData is used here to retrieve price feed data; however, there is insufficient protection against price staleness.
Return arguments other than int priceEurUsd
(answer
) are necessary to determine the validity of the returned price, as it is possible for an outdated price to be received.
https://github.com/Cyfrin/2023-12-the-standard/blob/91132936cb09ef9bf82f38ab1106346e2ad60f91/contracts/LiquidationPool.sol#L218
https://github.com/Cyfrin/2023-12-the-standard/blob/91132936cb09ef9bf82f38ab1106346e2ad60f91/contracts/LiquidationPool.sol#L207
The imapact is severe as inaccurate price data can lead to functions not working as expected and/or loss of funds.
Manual review
https://ethereum.stackexchange.com/questions/133242/how-future-resilient-is-a-chainlink-price-feed/133843#133843
The return value updatedAt contains the timestamp at which the received price was last updated, and can be used to ensure that the price is not outdated.
Several checks need to be added as well, please integrate a similar implementation :
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.