The ChainlinkOracle.sol
contract's _getData()
function retrieves price data from Chainlink's oracle but lacks crucial validation checks for stale or outdated data. While the function performs a basic validation that the price is greater than zero (require(data > 0, "INVLDDATA")
), it fails to implement essential checks for:
Round completeness
Round ID consistency
Timestamp staleness
The current implementation:
The lack of proper validation could lead to:
Usage of stale prices in critical protocol operations
Acceptance of outdated round data that could be significantly different from current market prices
Potential price manipulation if the oracle is not updating properly
Risk of financial losses for users if incorrect prices are used for liquidations, collateral calculations, or trading operations
Add comprehensive validation checks in the _getData()
function:
These changes ensure that:
The returned round is complete
The answer is from the latest round
The price data is not stale
The price is positive (existing check)
LightChaser: ## [Medium-4] Insufficient oracle validation
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.