When users wish to withdraw, they have to provide an execution fee with the assumption that the withdrawal will execute a GMX operation which costs a lot of gas. In some cases, dexes provide better prices for the operation so the gamma code will do a dex swap instead. In such dex swap withdrawals, the execution fee is not actually refunded, due to a bug.
The _burn() function deletes the depositInfo[depositId] of the operation, after which the deleted struct is checked:
The check on the marked line will always fail, because the struct has been deleted, so executionFee will be zero, rather than what it was supposed to be.
Refunds of large amounts of gas will not occur, and will remain stuck in the contract until the admin calls withdrawEth()
Manual review
Copy the depositInfo to memory before deleting it, and use the copy for the refund
Likelihood: High, every time a user withdraw on 1x vault with paraswap Impact: Medium, fees never claimed to GMX and refund to the owner.
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.