Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • TRADING
  • SUBMIT
Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • TRADING
  • SUBMIT
Crypto Flexs
Home»HACKING NEWS»Wake’s GMX Hacking Analysis and Attack Scenario
HACKING NEWS

Wake’s GMX Hacking Analysis and Attack Scenario

By Crypto FlexsJuly 25, 20253 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Wake’s GMX Hacking Analysis and Attack Scenario
Share
Facebook Twitter LinkedIn Pinterest Email

This analysis investigates a 42m attack on the GMX protocol. We provide detailed technical analysis of vulnerability and include work reproduction of attack scenarios for educational purposes in a forked environment.

Use the attack Mutual contract re -vulnerability Increases the detoured access control while the position increases. As a result, GLP token prices were operated at a higher price, allowing attackers to repay the tokens and extract profits from protocols.

Reproduction with Wake

  1. Replicate the repository
  2. GMX project dependency import:
    $ npm i
  3. Initialization Wake:
    $ wake up
  4. Receive and set ARBITRUM for URL from alchemy or other providers. .env Similar .env.example.
  5. Execution:
    $ wake test tests/test_attack_simple.py
  6. compromise print(tx.call_trace) To see the call tracking.

Root cause

The vulnerability comes from re -entry. Re -entry itself is simple, but its impact is important.

Core problem: GLP token price calculation globalShortAveragePrices Variable ShortsTracker. This dependence creates an exploited attack vector.

The vulnerability is a re -creation of mutual contracts. Many contracts have been related during the transaction. Each contract has a re -creation guard. However, the re -creation has already occurred after the termination of a specific contract.

Entry

The attack begins when the user increases the position.

  1. User call createIncreaseOrder To register an order
  2. Order Keeper Bot calls PositionManager.executeIncreaseOrder Run it
  3. within executeIncreaseOrder,,, ShortsTracker.updateGlobalShortData Called

ShortsTracker.updateGlobalShortData save globalShortAveragePrice In the case of tokens -average input price of all short positions. This value directly affects GLP token price calculations.

contract PositionManager 
    function executeIncreaseOrder(
        address _account,
        uint256 _orderIndex,
        address payable _feeReceiver
    ) external onlyOrderKeeper 
        //...
        IShortsTracker(shortsTracker).updateGlobalShortData(_account, collateralToken, indexToken, isLong, sizeDelta, markPrice, true);

        ITimelock(timelock).enableLeverage(_vault); // isLeverageEnabled <- True
        IOrderBook(orderBook).executeIncreaseOrder(_account, _orderIndex, _feeReceiver);
        ITimelock(timelock).disableLeverage(_vault); // isLeverageEnabled <- False

        _emitDecreasePositionReferral(_account, sizeDelta);
    

External currencies achieve this path Vault:

  • OrderBook.executeIncreaseOrder
    • Router.pluginIncreasePosition

that decreasePosition The flow follows a similar pattern.

that Vault.increasePosition The function checks it isLeverageEnabled Equivalent True Make sure the call occurs Timelock.enableLeverage and Timelock.disableLeverage. This inspection turned out to be insufficient.

contract Vault {
    // function has no msg.sender check.
    // Assumes caller transfers tokens or at least the caller is trusted.
    function increasePosition(
        address _account,
        address _collateralToken,
        address _indexToken,
        uint256 _sizeDelta,
        bool _isLong
    ) external override nonReentrant 
        _validate(isLeverageEnabled, 28); // this will be bypassed
        _validateGasPrice();
        _validateRouter(_account);
        ...
    ...

during Vault.decreasePositionThe contract transmits a collateral token for the closed location. If the mortgage token is Weth, the system withdrew the ETH and sent it to the user’s account. In particular, these WETH work occurs outside Vault contract.

The call flow proceeds as follows:

  • OrderBook.executeDecreaseOrder
    • Router.pluginDecreasePosition
      • Vault.decreasePosition
        1. REENTRANTRANCYGUARD set ENTERED
        2. Vault Close the location
        3. Send Weth to Orderbook
        4. REENTRANTRANCYGUARD set NOT_ENTERED
    • OrderBook Withdraw the ETH
    • ETH is sent to the user
      • User.receive Trigger
        • Vault.increasePosition (Abuse)
          1. Reentrancyguard checks NOT_ENTERED
          2. REENTRANTRANCYGUARD has been set ENTERED
          3. The attack continues…

Re -creation guard Vault Start NOT_ENTEREDHowever, after this status is reset, a re -entry call occurs and bypassed protection.

Attack escalation

directly Vault.increasePosition Bypass call ShortsTracker.updateGlobalShortDatacause GlpManager.getAum Returns the expansion value and artificially increases the price of GLP tokens.

Attack order:

  1. It goes back through an open entry point
  2. To get GLP tokens, add fluidity
  3. call increasePosition GLP token price is manipulated up
  4. Remove liquidity at the expansion GLP token price

Operation details

Used by an attacker RewardRouterV2.mintAndStakeGlp because GLPManager.inPrivateMode It is activated by preventing direct calls GLPManager.addLiquidity.

The attacker uses a flash loan with a USDC to create a large WBTC short position.

summation

The attack was successful due to the fragmentary data responsibility for the contract. Important status information is divided ShortsTracker and VaultREENTRANTRANTRANCY Guard is inefficiently rendered. This vulnerability has made the attacker manipulates the price of GLP tokens through a carefully adjusted re -entry phone to enable millions of exploits.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

Related Posts

Aave launches V4 testnet with developer preview of upcoming “Pro” experience.

November 22, 2025

Lido Triggerable Withdrawal Audit – Ackee Blockchain

November 20, 2025

Vault12 Guard now uses the CXP industrial protocol to retrieve iOS credentials from Apple Password.

November 18, 2025
Add A Comment

Comments are closed.

Recent Posts

Aave launches V4 testnet with developer preview of upcoming “Pro” experience.

November 22, 2025

Metaplanet plans to raise $135 million to buy more Bitcoin.

November 22, 2025

MEXC Launches Ethereum Eco Month With $1 Million Prize Pool

November 21, 2025

The RWA market is expected to surge in 2026, according to Plume Growth Forecast.

November 21, 2025

BTC price could be range-bound to $60,000-$80,000 pending a rate cut.

November 20, 2025

VerifiedX Partners With Crypto.com For Institutional Custody And Liquidity Solution

November 20, 2025

Bitcoin Policy Institute Launches Interactive US Tax Payment Model to Support Bitcoin For America Act

November 20, 2025

Lido Triggerable Withdrawal Audit – Ackee Blockchain

November 20, 2025

Numerai Raises $30 Million Series C Led By Top University Endowments, At $500 Million Valuation

November 20, 2025

Logos Unifies Under One Identity To Deliver A Private Tech Stack To Revitalise Civil Society

November 20, 2025

Tapbit Marks 4th Anniversary With Continued Focus On Innovation And User Trust

November 20, 2025

Crypto Flexs is a Professional Cryptocurrency News Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of Cryptocurrency. We hope you enjoy our Cryptocurrency News as much as we enjoy offering them to you.

Contact Us : Partner(@)Cryptoflexs.com

Top Insights

Aave launches V4 testnet with developer preview of upcoming “Pro” experience.

November 22, 2025

Metaplanet plans to raise $135 million to buy more Bitcoin.

November 22, 2025

MEXC Launches Ethereum Eco Month With $1 Million Prize Pool

November 21, 2025
Most Popular

XRP price maintains support – indicators show downside risks

March 29, 2024

Best Meme Coins to Buy Today Tuesday May 7 – Snek, 404Aliens, PepeFork, Dogeverse

May 8, 2024

FINRA said it reviewed rules that found 70% of cryptocurrency communications were violated.

January 24, 2024
  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions
© 2025 Crypto Flexs

Type above and press Enter to search. Press Esc to cancel.