So when lender signs RenegotiationOffer, it is meant to replace tranche, i.e. execute refinanceFull().
But a malicious user can use this sign and front-run execute addNewTranche().
addNewTranche() doesn't limit the RenegotiationOffer too much.
The newly generated Loan will be approximately twice the total amount borrowed, and the risk of borrowing against the lender will increase dramatically.
Impact
Maliciously using the signature of refinanceFull() to execute addNewTranche() will result in approximately double the borrowed amount, and the risk of borrowing will increase dramatically.
Recommended Mitigation
RenegotiationOffer Add a type field to differentiate between signatures.
Lines of code
https://github.com/code-423n4/2024-04-gondi/blob/b9863d73c08fcdd2337dc80a8b5e0917e18b036c/src/lib/loans/MultiSourceLoan.sol#L358 https://github.com/code-423n4/2024-04-gondi/blob/b9863d73c08fcdd2337dc80a8b5e0917e18b036c/src/lib/loans/MultiSourceLoan.sol#L194
Vulnerability details
Vulnerability details
in
MultiSourceLoan
refinanceFull()
andaddNewTranche()
use the same signatureSo when
lender
signsRenegotiationOffer
, it is meant to replacetranche
, i.e. executerefinanceFull()
.But a malicious user can use this sign and front-run execute
addNewTranche()
.addNewTranche()
doesn't limit theRenegotiationOffer
too much. The newly generatedLoan
will be approximately twice the total amount borrowed, and the risk of borrowing against thelender
will increase dramatically.Impact
Maliciously using the signature of
refinanceFull()
to executeaddNewTranche()
will result in approximately double the borrowed amount, and the risk of borrowing will increase dramatically.Recommended Mitigation
RenegotiationOffer
Add a type field to differentiate between signatures.Assessed type
Context