# Lend or mint after maturity

Illuminate Lender.mint/lend lacked a maturity check, letting an attacker mint post-maturity to dilute and sandwich legitimate redeemers for profit.

- Payout: Contest reward
- Severity: high
- Program: Illuminate
- Credited: HonorLt
- Disclosed: 2022-10-15
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2022-10-illuminate-judging/issues/208
- Library page: https://bugbountylibrary.com/r/sherlock%3A2022-10-illuminate%3AH-6
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic vuln:share-inflation

**Target:** Lender.sol mint/lend functions (ERC5095 principal token redemption)
**Root cause:** mint() and lend() have no check that block.timestamp is before maturity, so principal tokens can be minted after holdings are finalized, changing totalSupply used in the redemption formula (amount * holdings / totalSupply).
**Steps:**
1. Deploy scenario: userA mints 100, userB mints 200 -> totalSupply 300 ERC5095.
2. At maturity, redemption occurs; holdings[u][m] becomes 330.
3. userA calls redeem: expected 100*330/300 = 110.
4. Attacker userC frontruns by calling `mint(p,u,m,500)` post-maturity, raising totalSupply to 800.
5. userA's redeem now yields 110*330/800 = 45.375; holdings updates to 834.625.
6. userC redeems 500 shares: 500*834.625/700 ~= 596.16 (vs 550 expected), extracting the difference.
**How found:** Code review of mint()/lend() noting absence of a maturity/timestamp guard, then reasoning about how totalSupply feeds the redemption share formula to construct a dilution sandwich.
**Exploitation:** Attacker monitors the mempool for a legitimate redeem after maturity, frontruns with a large mint() to inflate totalSupply, lets the victim redeem at a diluted rate, then redeems their own shares to capture the surplus. Requires only capital to mint and no special privileges.
**Escalation:** Repeated sandwiching across multiple redeemers and markets scales the extracted value; remaining users also get skewed payouts.
**Insight:** When a share price is computed as holdings/totalSupply, any mint path lacking a maturity/epoch cutoff becomes a sandwich vector: check every entry point that changes totalSupply against the phase where holdings are finalized.
