Closed c4-bot-1 closed 5 months ago
0xSorryNotSorry marked the issue as sufficient quality report
0xSorryNotSorry marked the issue as primary issue
eswak (sponsor) disputed
I don't think that should be considered a valid code issue, this would be a governance issue. Terms with these parameters should be voted against by GUILD holders, or veto'd by GUILD or credit holders, and this would be an unsafe term to lend against.
The example in the documentation website is erroneous and I informed my colleague about this, thanks for pointing out.
Trumpero marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/main/src/loan/LendingTerm.sol#L758-L768
Vulnerability details
Impact
Some borrowers won't be incentivized to pay their loans, because under certain terms, it would be more profitable for them to be liquidated.
Proof of Concept
Under some terms, borrowers will find it more profitable to allow the loan to expire and be liquidated than to repay their debt. This is due to the extremely high
maxDebtPerCollateralToken
ratio. A notable example is provided here in the documentation, wheremaxDebtPerCollateralToken
is 0.99e18, and the interest is 0.05e18 (5%) paid every 3 months.With 5% interest paid 4 times a year, this will amount to 1.25% (as it's APR) of interest per payment. This means that by the first payment, the borrower will owe 100.25% of their collateral as debt, without counting the fee. If the fee is 0.5%, it will be 100.75%.
From the borrower's perspective, it will be more efficient to get liquidated rather than to pay off their debt. This will leave bad debt in the system and cause all users in the gauge to be slashed.
Example:
Same as above.
POC
Gist: https://gist.github.com/0x3b33/3c0445bea07bf2382595c0f8ec88dc5c Place in: 2023-12-ethereumcreditguild/test/unit/loan/.sol
Run it with: forge test --match-test test_causeBadDebt -vv
Tools Used
Manual review
Recommended Mitigation Steps
It's not preferable to target such high utilizations, as we reach a point where borrowers will prefer to be liquidated, as it will cost less compared to paying the debt.
Assessed type
Error