The GmxProxy.createOrder()
and settle()
functions do not properly ensure that the contract has enough ETH to cover the execution gas fees for order processing on GMX.
If the contract does not have enough ETH, orders may be rejected, delayed, or canceled, leading to failed trades, unexpected liquidations, or missed arbitrage opportunities.
Problems:
ETH Depletion Can Cause Stuck Orders
If the contract does not have enough ETH, no orders will execute, preventing users from trading.
Users do not know if an order will be rejected until after submission.
No Fallback Mechanism to Retry Execution
If an order is rejected due to low ETH, there is no way to retry execution without manually resubmitting the order.
Can Cause Unexpected Liquidations
If an emergency liquidation requires ETH for execution but fails, positions may remain open and accumulate losses, leading to unexpected liquidations at worse prices.
Lack of ETH Monitoring
There is no function to ensure the contract always maintains enough ETH for execution.
PoC
Exploit Scenario:
The contract does not have enough ETH to cover order execution fees.
A user submits an order, but the require(address(this).balance >= positionExecutionFee)
check fails.
The order does not execute, causing failed trades, missed arbitrage, or unnecessary liquidations.
Users Cannot Execute Orders - If the contract runs out of ETH, no new trades can be placed.
Unexpected Liquidations - If liquidation orders fail due to low ETH, positions may not close in time, causing unexpected losses.
Missed Arbitrage Opportunities - Users relying on price movements may miss favorable execution windows if their orders fail.
Manual Review, Foundry
If an order fails due to insufficient ETH, allow users to retry execution without resubmitting manually.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
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.