The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: medium
Invalid

`LiquidationPool.distributeAssets` will use the wrong price if the Chainlink registry returns price outside min/max range

Summary

The Chainlink aggregators include a circuit breaker that activates if an asset's price falls outside a preset price band. Consequently, during significant price drops (e.g., the LUNA crash), the oracle continues to report the minimum price instead of the asset's actual market price. This flaw allows borrowers to leverage the asset at an incorrect valuation. A similar situation occurred with Venus on BSC during the LUNA crash.

Vulnerability Detail

The current implementation does not check if the price falls within an acceptable range (between min and max price).

Impact

In a market downturn, this issue could result in the oracle returning an inaccurate price. This leads to miscalculations in costInEuro and results in the incorrect distribution of assets.

Tool Used

Manual Review

Recommendation

For each asset, a comprehensive check should be implemented. The system must revert transactions if the price is less than or equal to the minimum price or greater than or equal to the maximum price.

(, int256 priceEurUsd, , , ) = Chainlink
.AggregatorV3Interface(eurUsd)
.latestRoundData();
+require(minAnswer < priceEurUsd && priceEurUsd < maxAnswer, "Incorrect price");
...
(, int256 assetPriceUsd, , , ) = Chainlink
.AggregatorV3Interface(asset.token.clAddr)
.latestRoundData();
+require(minAnswer < assetPriceUsd && assetPriceUsd < maxAnswer, "Incorrect price");
Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

chainlink-minanswer

PTolev Submitter
over 1 year ago
hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

chainlink-minanswer

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.