Inside the GMX Exploit: When Modular Design Becomes an Attack Sur
A user-controlled receiver address in GMX V1's decreasePosition function allowed an attacker to reenter Vault.increasePosition mid-transaction, bypassing routing safeguards and manipulating the average short price of BTC. This inflated the value of GLP tokens, enabling the attacker to redeem them at a premium and drain over $40 million from the protocol.
On July 9, 2025, a critical design flaw in GMX V1’s architecture enabled an attacker to drain over $40 million from the protocol’s Arbitrum deployment. The exploit wasn’t due to an obscure zero-day or gas optimization mishap; it was a failure to constrain user-controlled receiver logic in decreasePosition, exposing…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Vault contract trusted that sensitive functions like increasePosition would only be called through approved routing contracts, and it transferred funds to a user-controlled receiver before finalising state, allowing a cross-contract reentrancy that bypassed price invariant checks.
Impact
The attacker drained over $40 million from the GLP liquidity pool, causing a 28% drop in GMX token price and forcing emergency shutdowns on Arbitrum and Avalanche; approximately $20 million was later recovered.
What the attacker needed
Ability to create a decrease order; ability to specify a malicious receiver contract; access to flash loans for leveraged positions
The fix
The text recommends locking all orchestrator pathways against cross-contract reentrancy, deferring fund transfers to the end of execution, and asserting core invariants before giving control to external contracts; it does not state that a specific fix was deployed.
How it was found
- Submit a decrease position with a malicious contract as the receiver.
- Funds are transferred before vault state is finalised.
- The receiver contract triggers a reentrant call to Vault.increasePosition.
- The call bypasses the average short price calculation, violating state assumptions.
- The exploit concludes with GLP overvaluation and liquidity drain.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
In a smart contract, a 'receiver' is the address that gets funds when a position is closed. If that address is a contract, it can run code when it receives funds. The attacker made that code call back into the protocol before the protocol finished updating its records, tricking it into calculating prices incorrectly and letting the attacker take more money than they should.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.