Submitted by 0xA5DF, also found by 0x52 and rbserver
When _addInterest() is called post maturity, the penalty rate is applied since the last time _addInterest() was called, including the period before maturity.
Borrowers will be charged with higher interest rates, when maturity date passes. The longer the time since _addInterest() was last called before maturity date the more extra-interest they will be charged.
Sidenote: I think this should be considered High, since it comes at the cost of the assets of the borrowers (even though it stems from unnecessary  fees being charged, similar to this Putty bug).
The test compares 2 scenarios, the 1st one where addInterest() isnt called for 30 days before maturity date, and in the 2nd it isnt called just for 1 day before.
The debt (not interest) in the first scenario would be ~50% higher than the second, see test output below.
At src/test/e2e/BorrowPairTest.t.sol Ive modified _fuzzySetupBorrowToken() to this and then ran source .env && forge test --fork-url $MAINNET_URL --fork-block-number $DEFAULT_FORK_BLOCK -m testFuzzyMaxLTVBorrowToken -vvv.
And Ive also modified src/test/e2e/BasePairTest.sol a bit so that each pair can have a different name for salt (see diff below).
Output:
When maturity date passes and the last time _addInterest() was called was before maturity date, calculate first the interest rate for that interval as normal interest rate, and then calculate penalty rate for the remaining time.
DrakeEvans (Frax) disputed, disagreed with severity and commented:
0xA5DF (warden) commented:
DrakeEvans (Frax) acknowledged
gititGoro (judge) decreased severity to Medium and commented:
