Critical vulnerability in updateGmxAddresses allows owner to instantly update all GMX integration addresses without
timelock, potentially disrupting protocol operations and active user positions while an order is in progress.
Currently we know the owner has the right to make lot of modification but what if there is a queue.requestKey which the bytes is not empty that could affect the order. So i feel the update still have to follow some certain procedures
According to the rules owner is able to update gmxAddress but that doesnt mean he should make modification any way he feels like when an order is still on.
For example an order is opened and the owner can set router address to zero which doesnt sit well.
I agree the owner have full permission but if the owner makes any mistake it affect users so there could be a minimal verification the owner is providing the right information at the very least.
Like it doesnt stop anything to even check if address(0) is provided by the owner when there is an active order .
The vulnerable function:
Key issues:
No timelock for address changes
No check for active orders in queue
Can affect ongoing order processing:
HIGH severity because:
Active orders could be disrupted by address changes
Users could lose funds if malicious addresses are set
No time for users to react to changes
Protocol integration with GMX could break mid-operation
Manual code review
This POC demonstrates:
Creates an active order that enters the queue
Updates GMX addresses while order is pending
Shows failure on cancellation of order
Order becomes stuck in queue
The foundry Response
Implement a timelock system for address updates:
This modification we make sure there isn't any active order or i feel we check for address zero also to just prevent active order from breaking
Fix 1:
Fix 2:
This ensures:
Changes have mandatory delay
Cannot update during active orders
Users have time to exit positions
Protocol stability maintained
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point. Keepers are added by the admin, there is no "malicious keeper" and if there is a problem in those keepers, that's out of scope. ReadMe and known issues states: " * System relies heavily on keeper for executing trades * Single keeper point of failure if not properly distributed * Malicious keeper could potentially front-run or delay transactions * Assume that Keeper will always have enough gas to execute transactions. There is a pay execution fee function, but the assumption should be that there's more than enough gas to cover transaction failures, retries, etc * There are two spot swap functionalies: (1) using GMX swap and (2) using Paraswap. We can assume that any swap failure will be retried until success. " " * Heavy dependency on GMX protocol functioning correctly * Owner can update GMX-related addresses * Changes in GMX protocol could impact system operations * We can assume that the GMX keeper won't misbehave, delay, or go offline. " "Issues related to GMX Keepers being DOS'd or losing functionality would be considered invalid."
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point. Keepers are added by the admin, there is no "malicious keeper" and if there is a problem in those keepers, that's out of scope. ReadMe and known issues states: " * System relies heavily on keeper for executing trades * Single keeper point of failure if not properly distributed * Malicious keeper could potentially front-run or delay transactions * Assume that Keeper will always have enough gas to execute transactions. There is a pay execution fee function, but the assumption should be that there's more than enough gas to cover transaction failures, retries, etc * There are two spot swap functionalies: (1) using GMX swap and (2) using Paraswap. We can assume that any swap failure will be retried until success. " " * Heavy dependency on GMX protocol functioning correctly * Owner can update GMX-related addresses * Changes in GMX protocol could impact system operations * We can assume that the GMX keeper won't misbehave, delay, or go offline. " "Issues related to GMX Keepers being DOS'd or losing functionality would be considered invalid."
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.