Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • ADOPTION
  • TRADING
  • HACKING
  • SLOT
  • CASINO
Crypto Flexs
  • DIRECTORY
  • CRYPTO
    • ETHEREUM
    • BITCOIN
    • ALTCOIN
  • BLOCKCHAIN
  • EXCHANGE
  • ADOPTION
  • TRADING
  • HACKING
  • SLOT
  • CASINO
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

How to Start with Web3 and Crypto -Dew Prehtation

July 23, 2025

FTT increases by 7% as the backpack starts the platform to help victims clear liquidation.

July 21, 2025

AAVE gains strength as AAVE dominates defect loans with net deposits of $ 50B or more.

July 19, 2025
Add A Comment

Comments are closed.

Recent Posts

Ripple CTO’s amazing regret for censorship

July 26, 2025

Ether Leeum validation exit exit queue will explode with 521,000 ETH ATH.

July 26, 2025

Wake’s GMX Hacking Analysis and Attack Scenario

July 25, 2025

Pepeto Announces $5.5M Presale And Demo Trading Platform

July 25, 2025

$75K In Rewards Announced For Valhalla’s First-Ever Tournament

July 25, 2025

Bitcoin Market Bullish? DL Mining Launches $100 Bonus + Sustainable Cloud Mining

July 25, 2025

Bybit And Tether Launch Strategic Partnership To Accelerate Crypto Adoption In Brazil

July 25, 2025

Remittix Presale Raises $17M After Revealing Next-Gen Web3 Wallet Beta Launch Date

July 25, 2025

Pioneering Real-World Asset Tokenization In The U.S. Market

July 25, 2025

How to travel to the world with encryption wallet?

July 25, 2025

LFG… Launches AI Alpha Pilot For Meme-Coin Hunters

July 24, 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

Ripple CTO’s amazing regret for censorship

July 26, 2025

Ether Leeum validation exit exit queue will explode with 521,000 ETH ATH.

July 26, 2025

Wake’s GMX Hacking Analysis and Attack Scenario

July 25, 2025
Most Popular

Dutch authorities arrest ZKasino fraud suspect, seize $12.2 million

May 5, 2024

Will Alts prices continue to rise?

December 21, 2024

After $3,000, could Ethereum price fall to $2,000 next?

April 18, 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.