The contract's _getData() function accepts any non-zero price value without enforcing maximum and minimum price boundaries, creating a significant risk during extreme market events or oracle price feed anomalies.
The vulnerable code in ChainlinkOracle.sol:
The function performs only a basic validation checking if the price is greater than zero. This implementation diverges from Chainlink's documentation which explicitly recommends implementing reasonable price boundaries. The absence of these checks means the contract will accept any price, regardless of how extreme it might be.
https://docs.chain.link/data-feeds#check-the-latest-answer-against-reasonable-limits
During market crashes or flash crashes, the oracle will continue processing trades using potentially catastrophic price levels. For instance, if an asset typically trading at $1000 suddenly drops to $1, the contract would accept this price as valid and execute trades accordingly. This scenario isn't theoretical – similar events have occurred in crypto markets, such as the LUNA crash and various flash crashes on major exchanges.
The vulnerability becomes particularly dangerous in automated trading systems where this oracle will be used. A sudden price crash could trigger a cascade of unfavorable liquidations or allow malicious actors to exploit the system fast-paced trading strategies.
Consider this scenario:
Asset normally trades at $1000
Flash crash occurs, dropping price to $1
Current implementation accepts $1 as valid price
Malicious actor uses this price to execute advantageous trades
Price recovers to $1000
Protocol and users suffer significant losses
Manual review
Update _getData() to check against min/max answer of the chailink price feed before consuming the price.
LightChaser: ## [Low-25] Chainlink answer is not compared against min/max values
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.