An attacker can make the vault stuck at status: "WITHDRAWAL" using an "out of gas" exploit that will hinder any other user to deposit / withdraw liquidity from any vault that uses the native token. In addition rebalancing the vault won't be possible.
Steps to reproduce:
An attacker deposits a small amount of tokens in a vault that contains the native token (ETH) in order to get some ownership to the vault's liquidity.
After the callback confirmation, the attacker sends the shares to an AttackerContract (see below).
Using the fundMe() method (see below), the attacker funds the AttackerContract with some ETH necessary to request a Withdrawal.
Attacker calls the createWithdrawal
method on the AttackerContract to create a withdrawal request, setting the vault status to WITHDRAW.
Whenever GMX, a keeper or any party tries to process the withdrawal, the call will revert in link1 because the receiver (=AttackerContract) will run out of gas the call due to the infinite loop defnied in the receive()
method (see example below). Subsequently the error won't be catched properly in link1, and the vault status won't be set to Withdraw_Failed or to OPEN link 5 and will be stuck at WITHDRAW status.
If needed a POC can be available upon request in a private git repository.
The vault cannot be rebalanced anymore link4, and users cannot deposit or withdraw any funds link3 unless the emergency pause is activated.
Forge unit testing
Add a gas limit to the call when transferring funds in the following line:
If the transfer fails (because of the out of gas or any other reason), the failure will be catched and the execution will be resum properly making it possible to regain the OPEN status in the vault.
Impact: High Likelihood: High An attacker can repeatedly force the protocol to get stuck in a not-open status. This can happen on both deposit, withdraw callback for both successful execution and failures. Will group all similar issues.
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.