The _handleReturn function uses incorrect deposit ID for execution fee refund
contracts/PerpetualVault.sol#L1129
When executing the refund logic, it first checks the balance of depositId with depositInfo[depositId].executionFee > usedFee, but then sends the funds to depositInfo[counter].owner.
This causes users to lose funds.
Recommended fix:
Likelihood: Medium/High, when withdraw on a 1x vault. 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.