OracleLib.sol latestRoundData() is used but there is no check to validate if the return value contains fresh data. Proper checks should be applied to prevent the use of stale price data.
If the function getUsdValue does not properly verify and handle incorrect data related to the priceFeed, it could lead to incorrect results in functions that depend on it, such as getAccountCollateralValue, this, in turn, could affect the calculation of users' health factor and affect other critical functions, potentially put the project's funds at risk.
It is crucial that any function using external data, such as token prices obtained from oracles or third-party price feeds (such as Chainlink in this case), performs appropriate checks and error handling to ensure the accuracy and security of the calculations.
This could lead to stale prices according to the Chainlink documentation:
https://docs.chain.link/data-feeds/price-feeds/historical-data
This, in turn, could affect the calculation of users' health factor and affect other critical functions, potentially put the project's funds at risk.
If the function getUsdValue does not properly verify and handle incorrect data related to the priceFeed, it could lead to incorrect results in functions that depend on it, such as getAccountCollateralValue, this, in turn, could affect the calculation of users’ health factor and affect other critical functions, potentially put the project’s funds at risk.
Manual Review
To ensure that the priceFeed is always correct, you can do that simply by adding some require statements in Oraclelib.sol.
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.