Normal behavior: _executeUnwindOperation is supposed to close a leveraged position by withdrawing enough collateral to repay the debt and flash loan, then return any remaining profit to the user.
Issue: The contract only withdraws collateral sufficient to cover the debt, and does not return the surplus collateral or profit to the user. Any remaining funds are permanently locked in the contract because there is no public withdraw function for users.
Likelihood:
Occurs whenever the calculated collateral to withdraw is less than the actual collateral held by the user.
Also happens when the flash loan repayment or 1inch swap only partially succeeds, leaving surplus collateral inside the contract.
Impact:
User funds (capital + profits) are permanently locked and cannot be recovered.
Causes a loss of trust in the Stratax platform, as unwinding positions may leave funds stranded or fail silently.
The PoC shows that after a standard unwind operation, any leftover collateral that exceeds the amount needed to repay the flash loan is not returned to the user. Since the contract does not provide a public withdrawal mechanism, these funds remain trapped forever inside the contract. This applies to both profit and excess collateral.
The mitigation ensures that any leftover collateral or profit after repaying the flash loan is immediately returned to the user who initiated the unwind. This prevents funds from being permanently locked in the contract. It also improves trust and reduces centralization risk, as users can retrieve all of their assets without relying on the contract 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.
The contest is complete and the rewards are being distributed.