# First depositor can brick market by forcing very large borrow rate

First depositor manipulates utilization above 100% via repay/redeem sequence, pushing borrow rate past max so _accrueInterest reverts and bricks the market.

- Payout: Audit contest
- Severity: medium
- Program: Malda
- Found by: Bobai23
- Disclosed: 2025-07-22
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2025-07-malda-judging/issues/86
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-07-malda%3AM-2
- Tags: area:web3 domain:web3 impact:dos kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic vuln:dos

**Target:** lending market interest rate model (JumpRateModelV4 / mToken)
**Root cause:** utilizationRate divides by (cash+borrows-reserves) which can be smaller than borrows, yielding util >1e18; getBorrowRate then exceeds borrowRateMaxMantissa and _accrueInterest reverts on every call.
**Steps:**
1. As first depositor, mint 1e18 tokens and borrow all against collateral in another market: cash=0, borrows=1e18, reserves=0.
2. Wait blocks for interest: borrows=1e18+1e12, reserves=5e11.
3. Repay borrows-reserves-1: cash=1e18+5e11-1, borrows=5e11+1, reserves=5e11.
4. Redeem full supply: cash=0, borrows=5e11+1, reserves=5e11.
5. utilizationRate = borrows*1e18/(cash+borrows-reserves) becomes ~5e11, getBorrowRate exceeds 0.0005e16, `_accrueInterest` reverts `mt_BorrowRateTooHigh` on all operations.
**How found:** Reading JumpRateModelV4 utilizationRate, noticed denominator cash+borrows-reserves can be less than borrows making util >1e18; constructed first-depositor repay/redeem sequence to maximize it and checked against borrowRateMaxMantissa require in _accrueInterest.
**Exploitation:** Attacker needs only be first depositor with collateral elsewhere; sequence of borrow, wait, partial repay, redeem leaves degenerate state where every market interaction reverts, permanently bricking the market.
**Insight:** When a utilization/ratio divides by (cash+borrows-reserves), test states where reserves approach borrows and cash is drained; first-depositor sequences can push ratios past caps that then revert all accrual paths.

