# Unlimited mint of Illuminate PTs is possible whenever any market is uninitialized and unpaused

Uninitialized market returns zero-address principal token; Safe.transferFrom to zero address succeeds, letting attacker mint unlimited Illuminate PTs free and drain redeemers.

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

**Target:** Lender.mint() / Marketplace.token() principal token lookup
**Root cause:** Lender.mint() does not verify the principal token address returned by Marketplace.token() is non-zero; for an uninitialized (u,m,p) market it returns address(0), and Safe.transferFrom on a zero-address token succeeds because no code check is performed.
**Steps:**
1. Observe setMarketPlace() called and IMarketPlace(marketPlace).token(u,m,0) set, but markets[u][m][p] for some p>0 still zero and paused[u][m][p] false (default).
2. Call `Lender.mint(p, u, m, a)` with that uninitialized p and arbitrary large a.
3. principal = IMarketPlace(marketPlace).token(u,m,p) returns address(0).
4. `Safe.transferFrom(IERC20(address(0)), msg.sender, address(this), a)` succeeds (low-level call to zero address returns success).
5. `IERC5095(principalToken(u,m)).authMint(msg.sender, a)` mints a Illuminate PTs to attacker for free.
6. Attacker redeems PTs via Redeemer.redeem() to drain other users' funds for that (u,m).
**How found:** Code review: noticed mint() trusts Marketplace.token() output without zero-address check, and that unpaused() defaults true for uninitialized markets; verified via Tenderly PoC that Safe.transferFrom to address(0) succeeds.
**Exploitation:** Attacker monitors setMarketPlace() and market creation; when a market for some principal p is undefined but unpaused, calls mint() with that p and a huge amount, receiving free Illuminate PTs, then redeems them to steal all funds backing that (u,m) market.
**Escalation:** Full insolvency of a given (u,m) market; overmint is silent and doesn't interfere with other operations.
**Insight:** When a protocol looks up a token address from a registry mapping, check whether uninitialized entries return address(0) and whether Safe/ERC20 transfer helpers silently succeed on zero-address targets — default-unpaused guards plus missing code checks turn a setup gap into free minting.
