DeFiFoundry
50,000 USDC
View results
Submission Details
Severity: low
Valid

Incorrect Price Validation for LongToken in _validatePrice(), KeeperProxy.sol

Summary

The _validatePrice function contains a mistake in price validation for the longToken.** **

Vulnerability Details

In the _validatePrice function, the following lines are checking the price of the longToken against the indexTokenPrice values:

_check(marketData.longToken, prices.indexTokenPrice.min); // incorrect
_check(marketData.longToken, prices.indexTokenPrice.max); // incorrect

However, the correct price range to check should be prices.longToken.min and prices.longToken.max, not the indexTokenPrice.

Impact

Incorrect Price Validation: The mistake can result in the system comparing the wrong price range for the longToken.

Tools Used

Manual review

Recommendations

The correct code should be:

_check(marketData.longToken, prices.longToken.min);
_check(marketData.longToken, prices.longToken.max);
Updates

Lead Judging Commences

n0kto Lead Judge 5 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding_validatePrice_no_check_for_longTokenPrice

Likelihood: None/Very Low, everytime the keeper send a price via run/runNextAction (sent by the Gamma keeper). Impact: Medium/High, does not check the longTokenPrice, it could go out of range. Keep in mind indexToken == longToken, an error from the keeper could be considered informational.

Support

FAQs

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