When redepositing liquidity in processWithdrawFailure
, the repay amounts are again borrowed even though the previous debt's have not been repaid. This will increase the leverage of the vault.
https://github.com/Cyfrin/2023-10-SteadeFi/blob/0f909e2f0917cb9ad02986f631d622376510abec/contracts/strategy/gmx/GMXWithdraw.sol#L231C12-L249
The previous debt is unpaid if GMXProcessWithdraw.processWithdraw() reverts
https://github.com/Cyfrin/2023-10-SteadeFi/blob/0f909e2f0917cb9ad02986f631d622376510abec/contracts/strategy/gmx/GMXProcessWithdraw.sol#L24-L105
GMXProcessWithdraw.processWithdraw() can be forcefully reverted by a user by providing a very high minWithdrawTokenAmt
https://github.com/Cyfrin/2023-10-SteadeFi/blob/0f909e2f0917cb9ad02986f631d622376510abec/contracts/strategy/gmx/GMXChecks.sol#L203-L228
The leverage of the vault can be forcefully increased by any depositor.
Use the funds returned from GMX instead of reborrow
Impact: High Likelihood: High Overlending is caused due to unnecessary re-borrow on processWithdrawFailure. Assumption that the repayment had gone because it was in try-catch is incorrect.
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.