Can force borrower to pay huge interest
The loan amount in the NFT loan facilitator acts as a minimum, so a lender can match a borrower's requested loan with a much larger amount. The borrower then owes interest on the full larger amount, potentially forcing them to pay far more interest than intended or risk losing their collateral.
Submitted by cmichel, also found by AuditsAreUS, csanuragjain, danb, IllIllI, joshie, Ruhum, t11s, and tintin
The loan amount is used as a min loan amount. It can be matched as high as possible (realistically up to the collateral NFT’s worth to remain in profit) and the borrower has to pay interest on the entire amount instead of just on the desired loan amount when the loan was created.
Proof of Concept
- User needs a 10k USDC loan, NFTs are illiquid and they only have a BAYC worth 350k$. So buying another NFT worth roughly the desired 10k$ is not feasible. They will put the entire 350k$ BAYC as collateral for the 10k USDC loan.
- A lender matches the loan calling
lendwith 350k USDC. - The borrower now has to pay interest on the entire 350k USDC even though they only wanted a 10k loan. Otherwise, they risk losing their collateral. Their effective rate on their 10k loan is 35x higher.
Recommended Mitigation Steps
The loan amount should not have min amount semantics. When someone wants to get a loan, they specify a certain amount they need, they don’t want to receive and pay interest on more than that.
wilsoncusack (Backed Protocol) disputed and commented:
The ability to increase the loan amount is seen as a feature of the protocol, not a bug.
gzeon (judge) decreased severity to Medium and commented:
While a larger loan size is strictly beneficial to the borrower, the higher interest payment it entitled is not. The warden suggested a valid situation that may cost the user more than intended. Considering the amount lost is bounded because the lender carry more risk for a larger loan, downgrading this to Medium risk for the sponsor to consider a maxLoanAmount parameter.
gzeon (judge) increased severity to High and commented:
After considering #9 bringing up the loan origination fee, I believe this is a High risk issue for the protocol to not have a
maxLoanAmountparameter.
wilsoncusack (Backed Protocol) commented:
IMO it does not make sense to label this as High severity. This is not an exploit but is just the protocol working exactly as described in the README.
From README
Perpetual lender buyout: a lender can be boughtout at any time by a new lender who meets the existing terms and beats at least one term by at least 10%, e.g. 10% longer duration, 10% higher loan amount, 10% lower interest. The new lender pays the previous lender their principal + any interest owed. The loan duration restarts on buyout.
I don’t agree that allowing higher loan amount necessarily means the loan amount needs to be unbounded. Given the increased interest and origination fee, a higher loan amount is not necessarily “beating existing terms” as described in the README.
wilsoncusack (Backed Protocol) commented:
It certainly doesn’t necessarily mean that but it is how we chose to implement it and I think the description is clear that there is no cap. We define “beating” as having one of those values changed by at least 10% and so I think it is beating as described by the readme.
Nonetheless, I appreciate your drawing focus again to this point (we discussed on twitter with our community during audit as this became a point of interest, and have of course considered this idea when designing the protocol at the outset). We will again consider adding a Boolean flag to each loan as to whether the borrower allows loan amount increases
wilsoncusack (Backed Protocol) commented:
Respect judge to have final say, but since this is going public want to make sure our take on this is clear.
We believe the protocol design was clearly communicated in the README, including origination fee and the possibility for perpetually increasing loan amount. We think there is no “exploit” here, just people pointing out potential downsides to how the protocol is designed (as one might point out problems of impermanent loss with an AMM.) We view these as QA reports. We are interested in this feedback and listening to it in that we want to listen to potential users and make sure our protocol appeals to as many people as possible.
I consider this as an exploit because asset can be lost. Combining unbounded loan amount, interest rate and origination fee (max 5%), a malicious lender can grief borrower with limited risk and get a chance to seize the collateral as demonstrated in the POC.
The fact that the code is working as described in README is irrelevant if it is going to make user lose their asset. If this is going to stay as a protocol design, I recommend to clearly communicate the risk of unbounded loan amount which is lacking in the contest repo.
wilsoncusack (Backed Protocol) resolved
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 loan amount parameter is implemented with minimum semantics rather than as a fixed requested amount, and there is no maximum loan amount the borrower will accept.
Impact
The borrower could be forced to pay interest on a much larger loan than requested, with an effective rate many times higher, or risk losing their collateral; the judge noted a malicious lender could grief the borrower with limited risk and a chance to seize the collateral.
What the attacker needed
Borrower creates a loan with collateral; lender matches with a larger amount
How it was found
- A borrower needs a 10k USDC loan and puts up a BAYC NFT worth 350k USD as collateral.
- A lender calls lend with 350k USDC, matching the loan at the higher amount.
- The borrower now owes interest on the entire 350k USDC instead of the 10k they wanted.
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.
In this lending system, a borrower asks for a loan and puts up an NFT as collateral. The code treats the requested amount as a minimum, so a lender can lend more than asked. The borrower must then pay interest on the larger sum, which can be much more expensive than planned.
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.