Details:
The updateGmxAddresses function in the GMProxy contract allows the owner to update critical contract addresses. However, the function does not validate the inputs to ensure they are non-zero or verify that they point to valid contracts. As a result, if an owner accidentally or maliciously provides a zero address (or an address without contract code) for any of these parameters, it could lead to malfunctioning of the GMProxy, potentially breaking the order execution flow and other related operations.
Root Cause:
Lack of proper input validation (non-zero address checks and contract code verification) in the admin function updateGmxAddresses.
Impact:
Misconfiguration Risk: If any address is set to zero or an incorrect contract address, critical functionality (such as order handling, liquidation, or data storage) may fail.
Operational Disruption: This could result in the GMProxy becoming non-operational, impacting trading operations and funds management.
Admin-Only Exploit: Although the function is protected by the onlyOwner modifier, a compromised owner account or human error could lead to these misconfigurations.
Recommendation:
Implement Input Validation: Add checks to ensure that none of the provided addresses are the zero address.
Optional Contract Verification: Consider verifying that each provided address contains contract code (using extcodesize) to ensure they point to deployed contracts.
Fail-Safe Mechanisms: Include proper revert messages to inform the owner of invalid inputs.
Proof of Concept:
The owner calls updateGmxAddresses with _gmxRouter set to address(0).
No validation is performed, so gmxRouter is set to address(0).
Subsequent calls that depend on gmxRouter will fail or revert due to calls being made to a non-contract address, potentially halting critical functionality in the system.
By adding proper validation, the contract can prevent such configuration errors and enhance overall security and operational reliability.
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.
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.
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.