Setting forSale to true results in anyone buying this loan from the original owner. This will insolvent the protocol as anyone will buy out anyone's loan offer at any time without the permission of the original lender.
Tools Used
Manual review
Recommended Mitigation Steps
set forSale to false as default. Users can set it to true using SetUserConfiguration
Lines of code
https://github.com/code-423n4/2024-06-size/blob/8850e25fb088898e9cf86f9be1c401ad155bea86/src/libraries/AccountingLibrary.sol#L81
Vulnerability details
Impact
Any existing loan can be bought because the default value of
forSale
is set to true.Proof of Concept
In
AccountingLibrary::createCreditPosition
andAccountingLibrary::createDebtAndCreditPositions
the value offorSale
parameter is set to trueSetting
forSale
to true results in anyone buying this loan from the original owner. This will insolvent the protocol as anyone will buy out anyone's loan offer at any time without the permission of the original lender.Tools Used
Manual review
Recommended Mitigation Steps
set
forSale
to false as default. Users can set it to true usingSetUserConfiguration
Assessed type
Other