The GMXProxy contract contains a critical vulnerability in the createOrder function where token approvals are incorrectly granted to the gmxRouter instead of the gExchangeRouter. This misconfiguration prevents the gExchangeRouter from accessing the approved tokens, leading to failed order creation and disruption of the protocol's functionality.
The vulnerability arises in the createOrder function when handling MarketSwap or MarketIncrease orders. The contract approves the gmxRouter for token transfers, but the actual token transfer is performed by the gExchangeRouter. Since the gExchangeRouter does not have the necessary allowance, the transaction fails, preventing the creation of orders.
Here is the mismatch between the approval target (gmxRouter) and the actual contract performing the token transfer (gExchangeRouter). This results in the gExchangeRouter lacking the necessary allowance to transfer tokens on behalf of the GMXProxy contract.
Deploy the GMXProxy contract and configure it with the necessary GMX components (gExchangeRouter, gmxRouter, etc.).
Approve the GMXProxy contract to spend tokens on behalf of a user.
Attempt to create a MarketIncrease order.
Output:
Orders requiring token transfers (e.g., MarketSwap or MarketIncrease) will fail, disrupting the protocol's functionality.
Users' funds may remain locked in the contract, as the tokens cannot be transferred to the orderVault.
Manual review.
Approve the gExchangeRouter instead of the gmxRouter in the createOrder function.
Router is the one collecting tokens: https://github.com/gmx-io/gmx-synthetics/blob/caf3dd8b51ad9ad27b0a399f668e3016fd2c14df/contracts/router/BaseRouter.sol#L46 https://github.com/gmx-io/gmx-synthetics/blob/caf3dd8b51ad9ad27b0a399f668e3016fd2c14df/contracts/router/Router.sol#L27
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.