Skip to content

Sherlock

GMX Update

Every publicly disclosed report for GMX Update and what kind of bugs they were.

disclosed reports
75
most reported class
Business logic
bug classes found
3
first disclosure
2023
Find GMX Update on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what GMX Update chose to make public.

Business logic

Stop-loss orders do not become marketable orders

Stop-loss orders in GMX fail to execute if the market price has moved past the trigger price by the time the order is processed, because the contract requires the primary and secondary oracle prices to straddle the trigger. An attacker could exploit this by submitting a stop-loss order and then causing the price to move quickly, leaving the order unexecutable and removing the user's stop-loss protection.

GMX Update

Medium
Business logic

Keepers can steal additional execution fee from users

The payExecutionFee function in GasUtils.sol calculates gas used without accounting for EIP-150's 63/64 rule, so a malicious keeper can inflate the reported gas usage by setting a high transaction gas limit. This allows the keeper to claim the entire execution fee paid by the user, leaving the user with no refund.

GMX Update

Medium
Business logic

Limit swap orders can be used to get a free look into the future

Limit swap orders could be cancelled after the trader learned the price at which they would execute, allowing a risk-free look at future prices. An attacker could submit a large limit order, observe oracle prices, and cancel if unprofitable, or submit a market order if profitable.

GMX Update

High
Business logic

Swaps associated with position orders will use the wrong price

The getLatestPrice() function returns a custom price (trigger or maximised price) set during a position order, and this same price is then used for subsequent token swaps within the same order. This means swaps after a position order use a different price than standalone swap orders, creating arbitrage opportunities.

GMX Update

High
Business logic

Virtual swap balances don't take into account token prices

Virtual swap balances in GMX Synthetics are tracked as raw token amounts without converting between the collateral token and the virtual token using an exchange rate. An attacker could exploit price differences between tokens to manipulate impact discounts and drain them from legitimate traders.

GMX Update

Medium
Business logic

User can loose funds in case if swapping in DecreaseOrderUtils.processOrder will fail

When a user executes a decrease order with a swap path, the minimum output amount is set assuming the swap will succeed and incur fees. If the swap fails, the same minimum output amount is validated against the unswapped amount, which is higher, so the user can receive less than they would have without the swap.

GMX Update

Medium
Business logic

Calc.boundedAdd used intitally but later regular subtraction used

The report identifies an inconsistency in the GMX Synthetics smart contract where a funding amount per size calculation uses a bounded addition function to prevent overflow, but a later subtraction uses a regular minus operator. This could cause an arithmetic overflow when negating the minimum integer value, leading to failed MarketDecrease orders.

GMX Update

Medium
Business logic

short side of getReservedUsd does not work for market that has the same collateral token

The getReservedUsd function for the short side does not account for price changes when the collateral token is the same as the index token, potentially leading to under-reserved funds and market insolvency. An attacker could exploit this by opening short positions in such a market, increasing the risk of insolvency if the collateral token's price drops.

GMX Update

Medium
Audit finding

MarketUtils.getFundingAmountPerSizeDelta() has a rounding logical error

The function MarketUtils.getFundingAmountPerSizeDelta() always rounds up the divisor regardless of the requested rounding mode, causing the final result to be rounded down when it should be rounded up. This leads to incorrect funding calculations for every user and every second, with errors growing as funding amounts increase.

GMX Update

Medium
Business logic

Limit orders can be used to get a free look into the future

Limit orders on GMX can be updated without delay, allowing a user to repeatedly adjust an order by a tiny amount to delay execution until a future block where the oracle price is known, giving them a free look at future prices. This lets them exit at a more favourable price at the expense of the counterparty.

GMX Update

High
Business logic

WNT in depositVault can be drained by abusing initialLongToken/initialShortToken of CreateDepositParams

The createDeposit function did not validate the initialLongToken and initialShortToken parameters, allowing an attacker to set them to a low-value token while the market's long or short token was WNT. This caused the execution fee to be subtracted from the wrong token amount, enabling the attacker to later cancel the deposit and drain WNT from the deposit vault.

GMX Update

High
Business logic

Missing checks for whether a position is still an ADL candidate

The ADL handler only checks global PnL levels, not whether a specific position is still a valid ADL candidate. An attacker could exploit a delay between candidate selection and execution to reduce their position, causing an incorrect further reduction.

GMX Update

Medium
Business logic

Gas spikes after outages may prevent order execution

Users must set an execution fee when creating an order, but if a keeper or oracle outage delays execution, gas prices can spike and the fee becomes insufficient. The user cannot increase the fee without changing the order timestamp, which invalidates the oracle price and may prevent execution, potentially causing losses or liquidation.

GMX Update

Medium
Business logic

Single-sided deposits that are auto-adjusted may have their collateral value cut in half

In the deposit logic, when a single-sided deposit triggers an auto-adjustment that increases the adjusted short amount, the adjusted long amount is never assigned and stays at zero. An attacker or user submitting such an order without a minimum output could receive roughly half the expected market tokens, while sane slippage settings would simply make the transaction revert.

GMX Update

Medium
Business logic

Keeper can make deposits/orders/withdrawals fail and receive fee+rewards

A malicious keeper can deliberately supply just enough gas for the execution of a deposit, order, or withdrawal to fail due to out-of-gas, but enough for the cancellation to succeed. This allows the keeper to collect the execution fee and rewards while cancelling the user's request.

GMX Update

Medium
Business logic

A single precision value may not work for both the min and max prices

The oracle price validation uses a single precision value for both minimum and maximum prices, which can cause the maximum price to exceed the representable range when the minimum price is near the precision limit. This could lead to oracle price fetching failures or users receiving less than they deserve, potentially causing unfair liquidations.

GMX Update

Medium
Audit finding

Multiplication after Division error leading to larger precision loss

The smart contract code performs division before multiplication in several places, causing precision loss in financial calculations. An attacker could potentially exploit this to manipulate funding rates or profit/loss accounting, though the report does not specify a concrete attack.

GMX Update

Medium
Audit finding

Missing checks for whether Arbitrum Sequencer is active

The protocol's price oracle does not check whether the Arbitrum sequencer is active, so if the sequencer goes down, prices from Chainlink feeds may be stale. An attacker could then submit orders and, if also a keeper, obtain execution prices that do not reflect reality.

GMX Update

Medium