GMX suffered a hacker attack, resulting in losses of more than $40 million. The attacker exploited a reentrancy vulnerability and opened a short position while the leverage function of theGMX suffered a hacker attack, resulting in losses of more than $40 million. The attacker exploited a reentrancy vulnerability and opened a short position while the leverage function of the

Losses exceeded $40 million, GMX hacking incident analysis

2025/07/10 11:00

GMX suffered a hacker attack, resulting in losses of more than $40 million. The attacker exploited a reentrancy vulnerability and opened a short position while the leverage function of the contract was enabled.

The root of the problem lies in the incorrect use of the executeDecreaseOrder function. The first parameter of the function should have been an external account (EOA), but the attacker passed in a smart contract address. This allowed the attacker to re-enter the system during the redemption process, manipulate the internal state, and ultimately redeem assets far exceeding the actual value of the GLP they held.

GLP normal redemption mechanism

In GMX, GLP is a liquidity provider token that represents a share of treasury assets (such as USDC, ETH, WBTC). When a user calls unstakeAndRedeemGlp, the system uses the following formula to calculate the amount of assets that should be returned:

redeem_amount = (user_GLP / total_GLP_supply) * AUM

The calculation method of AUM (total assets under management) is:

AUM = Total value of all token pools + Global short unrealized losses - Global short unrealized profits - Reserved amount - Default deduction (aumDeduction)

This mechanism ensures that GLP holders receive a proportional share of the actual assets of the treasury.

Problems after leverage is enabled

When enableLeverage is turned on, users can open leveraged positions (long or short). The attacker opened a large WBTC short position before redeeming GLP.

Since the short position increases the global short size as soon as it is opened, the system assumes that the short position is losing money when the price has not changed, and this part of the unrealized loss will be counted as the "asset" of the vault, causing the AUM to artificially increase. Although the vault does not actually gain additional value, the redemption calculation will be based on this inflated AUM, allowing the attacker to obtain assets far exceeding what he deserves.

Attack Process

Attacking transactions

Losses exceeded $40 million, GMX hacking incident analysis

Losses exceeded $40 million, GMX hacking incident analysis

Written at the end

This attack exposed serious flaws in GMX's leverage mechanism and reentrancy protection design. The core problem is that the asset redemption logic places too much trust in AUM and does not conduct sufficiently prudent security checks on its components (such as unrealized losses). At the same time, key functions also lack mandatory verification of the caller's identity assumptions (EOA vs contract). This incident once again reminds developers that when it comes to sensitive operations involving funds, they must ensure that the system state cannot be manipulated, especially when introducing complex financial logic (such as leverage, derivatives), and they must strictly prevent systemic risks caused by reentrancy and state pollution.

Market Opportunity
Moonveil Logo
Moonveil Price(MORE)
$0.002662
$0.002662$0.002662
+8.29%
USD
Moonveil (MORE) Live Price Chart
Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact service@support.mexc.com for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

Shocking OpenVPP Partnership Claim Draws Urgent Scrutiny

Shocking OpenVPP Partnership Claim Draws Urgent Scrutiny

The post Shocking OpenVPP Partnership Claim Draws Urgent Scrutiny appeared on BitcoinEthereumNews.com. The cryptocurrency world is buzzing with a recent controversy surrounding a bold OpenVPP partnership claim. This week, OpenVPP (OVPP) announced what it presented as a significant collaboration with the U.S. government in the innovative field of energy tokenization. However, this claim quickly drew the sharp eye of on-chain analyst ZachXBT, who highlighted a swift and official rebuttal that has sent ripples through the digital asset community. What Sparked the OpenVPP Partnership Claim Controversy? The core of the issue revolves around OpenVPP’s assertion of a U.S. government partnership. This kind of collaboration would typically be a monumental endorsement for any private cryptocurrency project, especially given the current regulatory climate. Such a partnership could signify a new era of mainstream adoption and legitimacy for energy tokenization initiatives. OpenVPP initially claimed cooperation with the U.S. government. This alleged partnership was said to be in the domain of energy tokenization. The announcement generated considerable interest and discussion online. ZachXBT, known for his diligent on-chain investigations, was quick to flag the development. He brought attention to the fact that U.S. Securities and Exchange Commission (SEC) Commissioner Hester Peirce had directly addressed the OpenVPP partnership claim. Her response, delivered within hours, was unequivocal and starkly contradicted OpenVPP’s narrative. How Did Regulatory Authorities Respond to the OpenVPP Partnership Claim? Commissioner Hester Peirce’s statement was a crucial turning point in this unfolding story. She clearly stated that the SEC, as an agency, does not engage in partnerships with private cryptocurrency projects. This response effectively dismantled the credibility of OpenVPP’s initial announcement regarding their supposed government collaboration. Peirce’s swift clarification underscores a fundamental principle of regulatory bodies: maintaining impartiality and avoiding endorsements of private entities. Her statement serves as a vital reminder to the crypto community about the official stance of government agencies concerning private ventures. Moreover, ZachXBT’s analysis…
Share
BitcoinEthereumNews2025/09/18 02:13
Zimbabwean Doctor Pushes for Appeal in $550,000 Crypto Theft Case

Zimbabwean Doctor Pushes for Appeal in $550,000 Crypto Theft Case

The post Zimbabwean Doctor Pushes for Appeal in $550,000 Crypto Theft Case appeared on BitcoinEthereumNews.com. A prominent Zimbabwean eye specialist is demanding
Share
BitcoinEthereumNews2025/12/20 20:59
Load The Bags! Bitcoin MVRV Hits Key Accumulation Threshold

Load The Bags! Bitcoin MVRV Hits Key Accumulation Threshold

The post Load The Bags! Bitcoin MVRV Hits Key Accumulation Threshold appeared on BitcoinEthereumNews.com. Load The Bags! Bitcoin MVRV Hits Key Accumulation
Share
BitcoinEthereumNews2025/12/20 21:10