Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Description
Brief/Intro
Here's the equation for utilisation that is being used currently U=TotalVariableBorrowAmount+TotalStableBorrowAmountTotalDeposits/TotalDeposits
When totalDeposits is lower than the totalBorrowed amount, the utilization can be much greater than 100%, which in turn makes borrowRates and depositRates very high.
Vulnerability Details
When a new token with CF > 0 is added, the attacker deposits 1e5 wei of its token, making TotalDeposits = 1e5.
Let's say the decimals for this newly added token are 1e18. The attacker then donates 1e18 wei of tokens directly to the HubPool and borrows.
This is allowed as there is no check for it in the borrow method. It makes the totalBorrows = 1e18.
Utilization is 1e13 in this case, which makes the interest rate ~4e31. This translates to 4 trillion percent per second.
After just a block, the attacker's original 1e5 deposits would have turned into a very large amount (in billions) due to the interest rate being an outrageous trillion percent per second.
The attacker goes ahead and borrows all the tokens against this deposit as CF for this token is non-zero.
Impact Details
Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Add below testcase in test/hub/HubPool.test.ts that shows the the interest rate is a very large amount when totalDeposits is way smaller than the totalBorrowedAmount