The process for updating the Market Configuration in GlobalConfigurationBranch
lacks a potentially catastrophic validation. This oversight can lead to a situation where nearly all user accounts become liquidatable. Specifically, self.maintenanceMarginRateX18
could be set to an excessively high value, which would disrupt the functionality of isLiquidatable()
.
In the GlobalConfigurationBranch
contract, the function to update the Market Configuration does not include a check to prevent excessively high values for maintenanceMarginRateX18
. If this parameter is set too high, it would cause nearly all user accounts to be flagged as liquidatable, severely destabilizing the liquidation market. This issue arises because the only check performed on maintenanceMarginRateX18
is to ensure it is not zero, without verifying that it falls within a reasonable range.
While the probability of this condition occurring is low, as it would likely result from an error by the owner of GlobalConfigurationBranch
, the potential impact is significant. If maintenanceMarginRateX18
is set to an excessively high value, the entire ecosystem could be destabilized by making all accounts liquidatable, leading to a cascade of liquidations.
The following code snippet shows how isLiquidatable()
within TradingAccount.sol
determines if an account is liquidatable:
If requiredMaintenanceMarginUsdX18
is set to an extremely high value, this condition will always evaluate to true, resulting in all accounts being marked as liquidatable.
Manual Review
Implement Range Check: Add a sanity check to ensure that maintenanceMarginRateX18
is within a reasonable range. This can be done by implementing a revert condition in updatePerpMarketConfiguration
to catch nonsensically high values.
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.