-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loan calls can be DoS'd by borrower if collateral is an ERC777 #1088
Comments
0xSorryNotSorry marked the issue as sufficient quality report |
0xSorryNotSorry marked the issue as duplicate of #685 |
Trumpero changed the severity to QA (Quality Assurance) |
Trumpero marked the issue as grade-b |
This previously downgraded issue has been upgraded by Trumpero |
Trumpero marked the issue as not a duplicate |
Trumpero marked the issue as duplicate of #184 |
Trumpero marked the issue as satisfactory |
Trumpero marked the issue as unsatisfactory: |
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/loan/LendingTerm.sol#L804
Vulnerability details
If a loan has not been repaid/partially repaid before the
maxDelayBetweenPartialRepay
, or when the gauge's term has been deprecated, anyone can call the loan in order to make it liquidatable.This is done through an auction, where users can bid on the loan for a debt to repay, and a collateral to get.
The closing of the loan is done through
LendingTerm::onBid
where the assets are sent/taken from the different actors.The issue is, as far as the collateral to send to the borrower is non-zero, the borrower can DoS the call by setting a callback that will make the transfer revert, making it impossible for other user to call its loan.
Impact
Loan are un-callable during the auction phase where collateral sent to borrower is non-zero, thus preventing the normal use of the protocol.
Proof of Concept
See
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/loan/LendingTerm.sol#L804
Tools Used
Manual audit
Recommended Mitigation Steps
Do not use a push pattern here, but rather a pull pattern for the borrower.
This mean to have a specific function for borrower to get the collateral once the call has been completed.
This way, he cannot interfer with the calling process.
Assessed type
Math
The text was updated successfully, but these errors were encountered: