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

Inconsistent Queue Deletion Across Order Types

Summary

The afterOrderExecution function inconsistently deletes the queue for MarketSwap and MarketDecrease orders but not delete it for Liquidation and ADL orders. This inconsistency can lead to stale queue state, unitended state pollution, or potential re-execution issues for Liquidation and ADL orders.

Vulnerability Details

if (
order.numbers.orderType == Order.OrderType.MarketSwap ||
order.numbers.orderType == Order.OrderType.MarketDecrease
) {
outputToken = eventData.addressItems.items[0].value;
outputAmount = eventData.uintItems.items[0].value;
}
// Construct order result data and notify perpetual vault
IGmxProxy.OrderResultData memory orderResultData = IGmxProxy.OrderResultData(
order.numbers.orderType,
order.flags.isLong,
order.numbers.sizeDeltaUsd,
outputToken,
outputAmount,
queue.isSettle
);
IPerpetualVault(perpVault).afterOrderExecution(requestKey, positionKey, orderResultData, prices);
delete queue;
}

The queue execution is only in the MarketDercrese and MarkerSwapping order types

Impact

Duplicate, processing
Possible, Exploitation
Residual Queue data

Tools Used

Manual Review

Recommendations

Add delete queue; for all Order types after complete execution

Updates

Lead Judging Commences

n0kto Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality
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.

Appeal created

olami9783 Submitter
5 months ago
n0kto Lead Judge
5 months ago
n0kto Lead Judge
5 months ago
n0kto Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality
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.