DeFiFoundry
50,000 USDC
View results
Submission Details
Severity: high
Invalid

Reliance on External Systems (GMX) could lead to financial losses and unfair liquidations

Summary

The interface relies heavily on the GMX protocol for order execution, position management, and collateral rebates. If GMX is compromised, delayed, or manipulated, it could lead to incorrect data being used in the protocol.

Vulnerability Details

The vulnerability can be found in the lines of code below;

https://github.com/CodeHawks-Contests/2025-02-gamma/blob/84b9da452fc84762378481fa39b4087b10bab5e0/contracts/interfaces/IGmxProxy.sol#L47-L50

https://github.com/CodeHawks-Contests/2025-02-gamma/blob/84b9da452fc84762378481fa39b4087b10bab5e0/contracts/interfaces/IGmxProxy.sol#L68-L72

Proof of Concept (PoC):

  • An attacker manipulates the GMX protocol to return incorrect position data or order execution results.

  • The createOrder or settle functions use the incorrect data to execute orders, leading to financial losses.

  • Example:

    function createOrder(Order.OrderType orderType, OrderData memory orderData) external returns (bytes32) {
    // GMX-specific logic
    }

If GMX returns incorrect data, the order execution will be incorrect.

Impact

Incorrect data could lead to financial losses, unfair liquidations, and protocol instability

Tools Used

Deepseek

Recommendations

  • Use multiple independent protocols to validate data and reduce reliance on a single source.

  • Implement data deviation checks to detect and respond to anomalies.

  • Add a grace period for data updates to account for potential delays.

Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!