The Strategy Vaults within the protocol use a two-step process for handling asset transfers via GMXv2. A createDeposit()
transaction is followed by a callback function (afterDepositExecution()
or afterDepositCancellation()
) based on the transaction's success. In the event of a failed deposit due to GMX checks, a malicious user can halt the protocol by causing an intentional revert in the processDepositCancellation function.
The processDepositCancellation
function is invoked when a deposit to the GMX fails and the corresponding afterDepositCancellation()
callback is triggered in the vault's callback contract. The function is designed to refund the user's deposited assets. However, there's a vulnerability when returning native tokens through a low-level call.
The vulnerability lies in the use of a low-level call to transfer native tokens, which checks for a successful transfer before completing the transaction. A malicious user can create a smart contract with a receive function that purposely fails, preventing the completion of the processDepositCancellation
function.
The exploit can lead to the processDepositCancellation
function consistently failing, which traps the contract in a perpetual "Deposit" state. This persistent state prevents any future interactions with the vault, effectively freezing its operations and could be leveraged to perform a denial-of-service attack on the protocol.
Manual analysis
To mitigate the risk, the protocol should avoid relying on the success status of the low-level call within the processDepositCancellation
function. One possible solution could be implementing a try-catch mechanism around the low-level call or not requiring the success of the call for the function to proceed. Here's the updated code suggestion:
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.