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 and vice versa.
The staleCheckLatestRoundData function in OracleLib.sol is only checking for the stale price. But no checks are done to handle that.
[21]
There is no function for checking only this as well in the library.
The checks are not done in DSCEngine.sol file.
There are two instances of that:
[345]
[363]
This would allow users to continue mintDsc, burnDsc etc. but at the wrong price. This is exactly what happened to Venus on BSC when LUNA crashed.
chainlink docs, foundry test and previous audit reports
Consider using the following checks:
Also some gas could be saved when used revert with custom error for doing the check.
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.