The emergencyClose() function allows the caller to specify a deadline by which any necessary swap calls must complete. However, it does not check if the provided deadline has already passed.
An attacker could call emergencyClose() with a deadline in the past, causing valid swaps made by the function to incorrectly fail due to the invalid deadline. This could prevent borrow positions from being properly unwound.
Reproduction Steps:
Caller invokes emergencyClose(), specifying a deadline timestamp from the past
Function performs swap calls with the expired deadline
Swap calls incorrectly fail due to the invalid deadline
Borrow positions may not fully repay due to rejected swaps
Manual Review
Add validation that the provided deadline is after the current timestamp before using it for swaps. This ensures swaps will not erroneously fail due to an already-expired deadline.
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.