Because the validCallback modifier in GmxProxy only whitelists a single set of handlers, callbacks from a second OrderHandler cause the contract to revert—this breaks the deposit flow (since afterOrderExecution() never runs), leaving users’ funds deposited on GMX without receiving corresponding shares, ultimately resulting in lost funds.
GmxProxy.sol recieves GMX callbacks via the afterOrderExecution() function. To avoid malicious callbacks from positions that don't belong to the PerpetualVault, the validCallback modifier is used:
According to the GMX documentation:
When creating a callback contract, the callback contract may need to whitelist the DepositHandler, OrderHandler or WithdrawalHandler, it should be noted that new versions of these handlers may be deployed as new code is added to the handlers, it is also possible for two handlers to temporarily exist at the same time, e.g. OrderHandler(1), OrderHandler(2), due to this, the callback contract should be able to whitelist and simultaneously accept callbacks from multiple DepositHandlers, OrderHandlers and WithdrawalHandlers
If there are two OrderHandlers, the GMXProxy will always revert when receiving callbacks from one of the two OrderHandlers.
This causes huge problems because the order will go through on the GMX side, but afterOrderExecution() won't run in the PerpetualVault.
During deposits to an open position, for example, shares are minted in afterOrderExecution, so the depositors funds will be add to the position, but they won't receive their shares causing loss of funds.
Loss of funds
Manual review
Allow for handling of multiple OrderHandlers.
Likelihood: Low, when multiple orderHandler exist at the same time. Impact: High, some orders won’t trigger `afterOrderExecution` when they should, until the migration is complete. Leading to DoS and no share minted. Deploying a new proxy won’t change anything during all the “migration” since you cannot know which handler will respond.
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.