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

Missing execution check in GmxProxy contract causes operational halts

Title

Missing execution check in GmxProxy contract causes operational halts

Summary

A missing feature check in the settle function of the GmxProxy contract could cause the protocol to stop working if the GMX execution feature is disabled. This issue needs to be addressed to prevent service disruptions.

Vulnerability Details

The settle function currently lacks a necessary check to ensure the GMX order execution feature is enabled. This is the same kind of issue that was previously identified in the createOrder function during an earlier audit. The absence of this check in settle can cause orders to be created successfully but not executed, leading to operational problems.

The required check should look like this:

bytes32 executeOrderFeatureKey = keccak256(abi.encode(EXECUTE_ORDER_DISABLED, orderHandler, orderType));
require(dataStore.getBool(executeOrderFeatureKey) == false, "gmx execution disabled");

Without this check, the protocol could face disruptions even though the issue was previously identified.

Impact

If the GMX execution feature is disabled while this vulnerability exists, orders will not be executed. This could lead to stalled operations that won't resume until the feature is re-enabled, requiring manual intervention like cancelling orders.

Tools Used

  • manual code review

  • comparison with previous audit findings

Recommendations

Add the missing GMX feature check to the settle function.

function settle(IGmxProxy.OrderData memory orderData) external returns (bytes32) {
require(msg.sender == perpVault, "invalid caller");
uint256 positionExecutionFee =
getExecutionGasLimit(Order.OrderType.MarketDecrease, orderData.callbackGasLimit) * tx.gasprice;
require(address(this).balance >= positionExecutionFee, "insufficient eth balance");
+ bytes32 executeOrderFeatureKey = keccak256(abi.encode(EXECUTE_ORDER_DISABLED, orderHandler, orderType));
+ require(dataStore.getBool(executeOrderFeatureKey) == false, "gmx execution disabled");
gExchangeRouter.sendWnt{value: positionExecutionFee}(orderVault, positionExecutionFee);
Updates

Lead Judging Commences

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

finding_execution_feature_not_checked

Likelihood: Low, when the execution is disabled on GMX. Impact: Low/Medium, cyclic settlement/cancelOrder loop.

Support

FAQs

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