Might not get desired min loan amount if _originationFeeRate changes
The minimum loan amount set by a borrower is interpreted as the pre-fee amount, so if the admin increases the origination fee after the loan is created, the borrower receives less than the intended minimum. This could leave the borrower with insufficient funds for their needs.
Submitted by cmichel, also found by teryanarmen
Admins can update the origination fee by calling updateOriginationFeeRate. Note that a borrower does not receive their minLoanAmount set in createLoan, they only receive (1 - originationFee) * minLoanAmount, see lend. Therefore, they need to precalculate the minLoanAmount using the current origination fee to arrive at the post-fee amount that they actually receive. If admins then increase the fee, the borrower receives fewer funds than required to cover their rent and might become homeless.
Recommended Mitigation Steps
Reconsider how the min loan amount works. Imo, this minLoanAmount should be the post-fee amount, not the pre-fee amount. It’s also more intuitive for the borrower when creating the loan.
wilsoncusack (Backed Protocol) disputed and commented:
Won’t change, is just how it works.
wilsoncusack (Backed Protocol) acknowledged, but disagreed with Medium severity and commented:
The only true mitigation here would be to store originationFeeRate in the Loan struct at the time of origination to guarantee a borrower gets the fee rate that was present when they created the loan. But we do not plan to make this change.
wilsoncusack (Backed Protocol) resolved and commented:
Decided to fix because we could do so without too much gas.
Sponsor confirmed with fix.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the minimum loan amount is treated as the pre-fee amount, and the fee rate is not locked at loan creation, so later fee increases reduce the net amount received.
Impact
A borrower could receive less than their specified minimum loan amount if the origination fee is increased after loan creation, potentially causing financial shortfall.
What the attacker needed
Borrower creates a loan with minLoanAmount; admin increases origination fee before loan is funded
The fix
The fix was to store the origination fee rate in the loan struct at origination, ensuring the borrower gets the fee rate present when they created the loan.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When you take a loan, you specify a minimum amount you need. But the system subtracts a fee from that amount before giving it to you. If the fee goes up after you set your minimum, you end up with less money than you asked for.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.