Malicious keeper can still DoS deposits and gain rewards using the 63/64 rule
Summary
Keepers can call _executeDeposit with 63/64 of the gas needed in order to avoid executing deposit and invoking _handleDepositError instead to receive rewards, if _handleDepositError passes with 1/64 of the total gas.
Vulnerability Detail
A malicious keeper can call executeDeposit and use only 63/64 of the required gas to that the _handleDepositError in the catch statement will be called instead.
Jaraxxus
medium
Malicious keeper can still DoS deposits and gain rewards using the 63/64 rule
Summary
Keepers can call _executeDeposit with 63/64 of the gas needed in order to avoid executing deposit and invoking
_handleDepositError
instead to receive rewards, if_handleDepositError
passes with 1/64 of the total gas.Vulnerability Detail
A malicious keeper can call
executeDeposit
and use only 63/64 of the required gas to that the_handleDepositError
in the catch statement will be called instead.Impact
Malicious keeper can get funds by purposely denying execution
Code Snippet
https://github.com/sherlock-audit/2023-04-gmx/blob/main/gmx-synthetics/contracts/exchange/DepositHandler.sol#L92-L114
Tool used
Manual Review
Recommendation
Add additional checks to make sure that keeper doesn't use 63/64 of the gas to purposely invoke the _handleDepositError function.
Related to M-31.