-
Notifications
You must be signed in to change notification settings - Fork 0
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
Spam function refinancePartial()
could DOS refinance by passing empty _renegotiationOffer.trancheIndex
list
#57
Comments
0xA5DF marked the issue as primary issue |
Similar to #35, keeping it separate for now |
0xA5DF changed the severity to QA (Quality Assurance) |
Marking as low, this would require lots of resources and there's no significant motivation for the attacker |
0xA5DF marked the issue as grade-c |
Moved to #70 |
Yeah, the root cause is similar (despite being present in different functions), I'd dupe this with 25% due to not identifying the more significant impact |
This previously downgraded issue has been upgraded by 0xA5DF |
0xA5DF marked the issue as duplicate of #35 |
0xA5DF marked the issue as satisfactory |
0xA5DF marked the issue as partial-25 |
Lines of code
https://github.com/code-423n4/2024-04-gondi/blob/b9863d73c08fcdd2337dc80a8b5e0917e18b036c/src/lib/loans/MultiSourceLoan.sol#L257
Vulnerability details
Impact
The Gondi protocol has created an open market where anyone can refinance a loan, provided the new loan term is better than the previous one by a certain percentage (5-10%). To interact with an existing loan (either by refinancing or renegotiating), users need to input the
loanId
. The refinanced or renegotiated loan is then tracked by a new loan ID.The function
refinancePartial()
allows anyone to refinance some tranches of an existing loan. The caller specifies which tranches to refinance by providing a_renegotiationOffer.trancheIndex
list. This list can be empty. If the_renegotiationOffer.trancheIndex
list is empty, a new loan ID is simply created to track the loan without altering any parameters of the existing loan.This could be exploited by an attacker to prevent other users from interacting with a specific loan. The attacker could call
refinancePartial()
with an empty trancheIndex list, incurring no cost beyond the gas cost. If the attacker sees a transaction in the mempool attempting to refinance or renegotiate a loan, they can front-run the transaction and call therefinancePartial()
function. This changes the loan ID, invalidating the offer in the other transaction and causing it to revert.Proof of Concept
Consider the parameters the attacker needs to input to spam
refinancePartial()
without incurring any cost.As we can see, users won't pay any protocol fee or refinance any tranche, yet a
newLoanId
is still created and the existing loan is set to thisnewLoanId
.Tools Used
Manual Review
Recommended Mitigation Steps
Add a check to ensure
_renegotiationOffer.trancheIndex.length > 0
.Assessed type
DoS
The text was updated successfully, but these errors were encountered: