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

Unimplemented Frozen Order Handler Leading to System Failure

Summary

The afterOrderFrozen callback function in GmxProxy contract is completely empty despite being a critical part of the order lifecycle. When orders become frozen on GMX protocol, the system fails to handle these cases, leading to stuck orders and system lockup.

Vulnerability Details

function afterOrderFrozen(
bytes32 key,
Order.Props memory order,
EventLogData memory
) external override validCallback(key, order) {}

The afterOrderFrozen function is empty with no implementation and no handling of state changes on the queue.

OrderQueue public queue;

When an order becomes a frozen state the order in the queue remains active without any update to the requestKey and no cleanup to the queue.

modifier validCallback(bytes32 key, Order.Props memory order) {
require(
msg.sender == address(orderHandler) ||
msg.sender == address(liquidationHandler) ||
msg.sender == address(adlHandler),
"invalid caller"
);
require(order.addresses.account == address(this), "not mine");
_;
}

The validCallback modifier only validates the caller and account but does not validate the order status in the queue and does not check whether the order has been previously frozen.

This can cause frozen orders to still appear active and DOS the system when the order is frozen on the GMX protocol.

Impact

  • Frozen orders will still appear active

  • DOS

Tools Used

  • Manual review

Recommendations

Clear queue if order is current order.

function afterOrderFrozen(
bytes32 key,
Order.Props memory order,
EventLogData memory eventData
) external override validCallback(key, order) {
// 1. Clear queue if this order is current order
if (queue.requestKey == key) {
delete queue;
}
// 2. Notifications to PerpetualVault
IPerpetualVault(perpVault).onOrderFrozen(key, order);
// 3. Emit event for tracking
emit OrderFrozen(key, order.addresses.account, block.timestamp);
}
Updates

Lead Judging Commences

n0kto Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

Suppositions

There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.

Support

FAQs

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