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 integrating with protocol with wrong price.
NB: This is exactly what happened to Venus on BSC when LUNA imploded.
Take a look at DSCEngine.sol#L350-L359
This function is used to iterate through all the collateral tokens a user has and provide the summation of all their values in usd, now the function calls the getUsdValue() function:
This function just queries the price from chainlink and retrieves the latest round data from the aggregator, but there is no check for the minAnswer
circuit breaker. This circuit breaker is a built-in mechanism in Chainlink aggregators that prevents the price from going outside a predefined range.
Example:
Consider fetching the price of any erc20 token in USD, say ABC.
Let's assume that ABC has a minAnswer
value set at $0.1. Now, imagine a situation where the actual price of ABC plummets to $0.01 due to market conditions.
Despite the significant drop in value, the aggregator continues to report the price of ABC as $0.1. Consequently, the DSCEngine.sol contract would be misled into thinking ABC is collateral value would be somewhat inflated, in the case where user only has the ABC token as a collateral then the DSCEngine.sol contract would assume thier collateral value to be times 10 the value it really is
In short wrong collateral value assumption for users
Manual Audit
Implement a check for the minAnswer
circuit breaker. If the returned price falls below the minAnswer
threshold, DSC should handle it appropriately.
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.