Steadefi

Steadefi
DeFiHardhatFoundryOracle
35,000 USDC
View results
Submission Details
Severity: medium
Valid

Repayment Failure May Leave Borrow Position Intact

Summary

The emergencyClose() function calls repay() to unwind the borrow position, but does not validate that the repayment completed successfully.

Vulnerability Details

If repay() reverts or fails to fully repay the borrowed assets for any reason, the contract state and borrow would be left in an inconsistent, partially repaid state.

144 GMXManager.repay(
145 self,
146 _rp.repayTokenAAmt,
147 _rp.repayTokenBAmt
148 );

Reproduction Steps:

  1. Call emergencyClose() during exploit of repay()

  2. repay() reverts or does not fully repay amounts

  3. Function does not detect repay() failure

  4. Borrow position remains outstanding

Impact

Borrower could retain access to loaned assets after attempted close

Tools Used

Manual Review

Recommendations

Validate repay() executes fully by checking borrow balances are zeroed. Revert state on any validation failures to avoid partial closures leaving funds exposed.

Updates

Lead Judging Commences

hans Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

Not enough token to repay the debt on emergencyClose

Impact: Medium Likelihood: Low The keepers can send tokens directly before closing. Will leave for a sponsor's review but likely to invalidate.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.