Submitted by Infect3d, also found by 0xpiken and falconhoof
While the documentation states that in case of fixed term market the APR cannot be changed until the term ends, nothing prevents this in FixedTermLoanHooks.
In Wildcat markets, lenders know in advance how much APR the borrower will pay them. In order to allow lenders to exit the market swiftly, the market must always have at least a reserve ratio of the lender funds ready to be withdrawn.
If the borrower decides to reduce the APR, in order to allow lenders to ragequit, a new reserve ratio is calculated based on the variation of the APR as described in the link above.
Finally, is a market implement a fixed term (date until when withdrawals are not possible), it shouldnt be able to reduce the APR, as this would allow the borrower to rug the lenders by reducing the APR to 0% while they couldnt do anything against that.
The issue here is that while lenders are (as expected) prevented to withdraw before end of term:
https://github.com/code-423n4/2024-08-wildcat/blob/main/src/access/FixedTermLoanHooks.sol#L857-L859
this is not the case for the borrower setting the annual interest:
https://github.com/code-423n4/2024-08-wildcat/blob/main/src/access/FixedTermLoanHooks.sol#L960-L978
Borrower can rug the lenders by reducing the APR while they cannot quit the market.
Add this test to test/access/FixedTermLoanHooks.t.sol
When FixedTermLoanHooks::onSetAnnualInterestAndReserveRatioBips is called, revert if market.fixedTermEndTime > block.timestamp.
laurenceday (Wildcat) disputed and commented via duplicate issue #23:
3docSec (judge) decreased severity to Medium and commented via duplicate issue #23:
