Data Validation
, Denial of Service
, Logic Issue
The afterOrderExecution
callback reverts on unauthorized callers and performs division operations on zero values, contradicting the requirement that it must never revert.
afterOrderExecution
checks msg.sender != address(gmxProxy)
and reverts if the caller is not the gmxProxy
. It also divides by prices.shortTokenPrice.min
, which triggers a division-by-zero revert if the incoming data is zero. These behaviors break the contract’s stated requirement of never reverting in its post-execution logic, causing unnecessary denial of service risks.
Impact: Medium. The callback reverts and halts operations whenever unexpected callers invoke it or when external price feeds report zero. The protocol experiences downtime that disrupts order flows.
Likelihood: Low. Only the authorized GMX proxy normally invokes afterOrderExecution, and real-time Chainlink or GMX price feeds rarely return zero.
A third-party system mistakenly invokes afterOrderExecution instead of the authorized gmxProxy.
The function reverts with Error.InvalidCall().
The contract never completes its post-order logic.
Alternatively, a zero price input triggers a division-by-zero revert, blocking successful execution.
Replace reverts on invalid callers with a no-op or a logged warning if the contract must never revert:
Validate that prices.shortTokenPrice.min != 0
before performing divisions to prevent unexpected halts:
Ensure fallback logic handles abnormal external data without reverting.
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.
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
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.