Chainlink aggregators have a built in circuit breaker if the price of an asset goes outside of a predetermined price band. The result is that if an asset experiences a huge drop in value (i.e. LUNA crash) the price of the oracle will continue to return the minPrice instead of the actual price of the asset. This would allow user to continue borrowing with the asset but at the wrong price. This is exactly what happened to Venus on BSC when LUNA imploded.
DSCEngine.sol::getTokenAmountFromUsd()
when return the priceFeed
call the OracleLib.sol::staleCheckLatestRoundData()
in this function there is check for stale but what if the answer
returns price outside min/max range
so priceFeed
will use the wrong price if the OracleLib.sol::staleCheckLatestRoundData()
returns price outside min/max range.
In the event that an asset crashes (i.e. LUNA) the protocol can be manipulated to give out loans at an inflated price
Manual Review
OracleLib.sol::staleCheckLatestRoundData()
should check the returned answer against the minPrice/maxPrice and revert if the answer is outside of the bounds:
Implement the proper check for each asset. It must revert in the case of bad price.
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.