https://github.com/CodeHawks-Contests/2025-02-gamma/blob/84b9da452fc84762378481fa39b4087b10bab5e0/contracts/PerpetualVault.sol#L1220-L1236
In case PerpetualVault::cancelFlow needs to be invoked, if the current flow is FLOW.WITHDRAW, the refunded fees will be transferred to the last depositor of this vault instead of the user withdrawing the funds.
PerpetualVault::cancelFlow invokes _cancelFlow which in case of the flow being FLOW.WITHDRAW, it will refund the fees to depositInfo[counter].owner instead of to the user who initiated the withdraw function.
The user who initiated the withdraw function will not receive the fees back
Manual review
Likelihood: Low, contract has to call cancelFlow after a withdraw, and the settle action is already executed by GMX. Impact: High, the fees will be distributed to the last depositor and not the withdrawer.
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.