Skip to content
$1,000,000 in security audit grants are live now, Apply here →

Security review · July 2025

V2.2 Crosschain, Part 7

for GMX

GMX engaged Guardian to review the security of their GMX Crosschain architecture. From the 21st of July to the 25th of July, a team of 2 auditors reviewed the source code in scope.

Published
Review window
July 21 to 25, 2025
Language
Solidity
Chains
Arbitrum, Avalanche
Sector
Perpetuals
  • 0 Critical
  • 1 High
  • 0 Medium
  • 8 Low
  • 0 Informational

4 resolved · 5 acknowledged

Scope

Overview

GMX engaged Guardian to review the security of their GMX Crosschain architecture. From the 21st of July to the 25th of July, a team of 2 auditors reviewed the source code in scope.

Findings 9

  1. H-01 High Secondary Amount Is Not Bridged Out Logical Error Resolved
    Location
    BridgeOutFromControllerUtils.sol: 142

    Description

    In the bridgeOutFromController function for tokens and secondaryTokens the _bridgeOutParams.amount is assigned as only the params.amount in the first case, ignoring the secondaryAmount entirely.

    This misses the secondary token amount that should be bridged out in the event that both output tokens are the same token.

    Recommendation

    Assign the _bridgeOutParams.amount as params.amount + params.secondaryAmount in the first case.

    Resolution

    GMX Team: Resolved.

  2. L-01 Low Some Tokens Incompatible With Edge Oracle Warning Acknowledged
    Location
    EdgeDataStreamProvider.sol

    Description

    Depending on the token decimals and corresponding edge oracle decimals there may be some tokens which cannot be used with the edge oracle due to the token decimals multiplier calculations.

    For example:

    • Token has 18 decimals
    • Expo is -14
    • floatMultiplier = 30 - 18 - 14 = -2

    A resulting negative multiplier reverts with the InvalidEdgeDataStreamExpo error.

    Recommendation

    Consider if tokens which have a net negative float multiplier due to high decimals or a high exponent should be supported by using a division of 10^(-floatMultiplier). Otherwise be aware of this incompatibility for exotic tokens.

    Resolution

    GMX Team: Acknowledged.

  3. L-02 Low Max Data List Length Warning Configuration Acknowledged
    Location
    Global

    Description

    With the addition of the minimum output amount configuration for the user, the maximum datalist length should be increased as necessary to be able to include a minimum amount out value for both the primary output token and secondary output token if there is one for the action.

    Recommendation

    Be sure that the largest required data list length can be supported by the validation.

    Resolution

    GMX Team: Acknowledged.

  4. L-03 Low Lacking From And To Validations Validation Resolved
    Location
    ClaimHandler.sol

    Description

    In the transferClaim function there is no validation preventing the from and to addresses from being the same account. This may lead to unexpected issues and should be explicitly prevented to avoid mistakes.

    Recommendation

    Consider adding validation to ensure that the from and to addresses of each TransferClaimParam are unique.

    Resolution

    GMX Team: Resolved.

  5. L-04 Low Misleading Account Emitted Events Resolved
    Location
    ClaimHandler.sol

    Description

    In the emitClaimFundsClaimed invocation in the claimFunds function the receiver is emitted as the account, however the msg.sender is the account that claimed funds.

    This may be misleading to consumers of the emitClaimFundsClaimed emission.

    Recommendation

    Consider using the msg.sender as the account field for the emitClaimFundsClaimed invocation.

    Resolution

    GMX Team: Resolved.

  6. L-05 Low Terms Should Be Set Before Depositing Warning Acknowledged
    Location
    ClaimHandler.sol

    Description

    The setTerms function should be called for a given distributionId that requires terms before the depositFunds function is used for that distributionId.

    This is because it is possible for an actor to withdraw their distribution immediately after the depositFunds function is used, without signing any terms if they are not configured at that point.

    Recommendation

    Be sure to call the setTerms function before the depositFunds function for any distributions which require terms.

    Resolution

    GMX Team: Acknowledged.

  7. L-06 Low Lacking Signature Deadline Or Nonce Validation Acknowledged
    Location
    ClaimHandler.sol

    Description

    The validateTermsSignature validation does not include any deadline for when the signature made by the user should become invalid, or Nonce which makes signature uses unique.

    This may be unexpected especially if a user makes an initial claim for a distributionId before their allocation for that distributionId is increased and they are able to claim again.

    Recommendation

    Consider adding mechanisms that more strictly define the use of a user’s signature such as a nonce and deadline.

    Resolution

    GMX Team: Acknowledged.

  8. L-07 Low Lacking Domain Separator Best Practices Resolved
    Location
    ClaimHandler.sol

    Description

    There is no domain separator included in the validateTermsSignature signature validation. This means a signature of terms could be potentially used across multiple contracts or even on other chains if a ClaimHandler were to be deployed on multiple networks.

    Recommendation

    Consider adding a domain separator to make signatures specific to the context in which they are meant to be used.

    Resolution

    GMX Team: Resolved.

  9. L-08 Low Min Amount Is Altered Unexpected Behaviour Acknowledged
    Location
    LayerZeroProvider.sol

    Description

    In the prepareSend function the sendParam.minAmountLD is re-assigned to receipt.amountReceivedLD.

    Therefore if for any reason the amount received by the user on the stargate.send invocation would be less than the receipt.amountReceivedLD but more than the sendParam.minAmountLD then the send would fail even though the minimum amount specified by the user could have been met.

    Recommendation

    This case should not be possible since the quoteOFT call should always return the exact result of the send.

    However consider if the minAmountLD should be left as the user’s specified sendParam.minAmountLD so that this case cannot arise with any underlying stargate pool or OFT implementation.

    Resolution

    GMX Team: Acknowledged.

More from GMX

All 44 reports
  1. Timelock Updates

    4 findings 4 findings: 3 low, 1 informational
  2. LayerZeroProvider Routing

    1 finding 1 finding: 1 medium
  3. Open Interest Updates

    5 findings 5 findings: 2 medium, 3 low
  4. Updates Branch

    2 findings 2 findings: 2 low

Put your code through the same review.

This review started with a conversation about scope. Tell us what you are building and we will plan yours with you.

Get a quote