The GMXProxy contract uses a single OrderQueue struct to track orders, which creates a race condition when multiple orders are processed concurrently. This design flaw allows new orders to overwrite the queue before previous orders are resolved, leading to incorrect callback handling and potential state corruption in the PerpetualVault.
The contract maintains a single OrderQueue struct to store the requestKey and isSettle flag for orders. When multiple orders are created in quick succession, the queue is overwritten, causing the contract to lose track of pending orders. This results in incorrect handling of callbacks, as the contract cannot reliably associate callback data with the correct order.
The root cause is the use of a single OrderQueue struct to track all orders. This design does not account for concurrent order processing, leading to data overwrites and incorrect callback handling.
Deploy the GMXProxy contract and configure it with the necessary GMX components.
Create two orders in quick succession to trigger the race condition.
Verify that the second order overwrites the first order in the queue.
Output:
Callbacks for overwritten orders may be associated with the wrong order, leading to incorrect state updates in the PerpetualVault.
The PerpetualVault may update its state based on incorrect order data, potentially causing financial losses or protocol instability.
Manual review.
Replace the single OrderQueue with a mapping to track orders by requestKey.
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.
Order is proceed one by one and requestKey is only used to cancelOrder. I didn’t see any real scenario where it will cause a problem. Flow and gmxLock will prevent that to happen.
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.