# Shezmu: unauthenticated mint() in collateral token drains vault

Shezmu collateral token's mint() lacked access control, letting attacker mint unlimited collateral, borrow ShezUSD, and drain ~$4.9M.

- Payout: Real-world hack
- Severity: critical
- Program: Shezmu
- Credited: DeFiHackLabs
- Disclosed: 2024-09-20
- Write-up quality: 6/10
- Original: https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2024-09/Shezmu_exp.sol
- Library page: https://bugbountylibrary.com/r/dhl%3A20240920-shezmu
- Tags: domain:web3 impact:funds-loss kind:incident platform:defihacklabs sev:critical tech:evm tech:solidity technique:source-review vuln:access-control vuln:business-logic

**Target:** Shezmu Vault collateral token contract (0x641249...) and vault proxy (0x75a04...)
**Root cause:** The collateral token's mint() function had no access control, allowing anyone to mint arbitrary collateral. The vault trusted this collateral for borrowing, enabling unbacked ShezUSD loans.
**Steps:**
1. Deploy AttackContract and call attack()
2. `IShezmuCollateralToken(COLLATERAL_TOKEN).approve(SHEZMU_VAULT_PROXY, type(uint256).max)`
3. `IShezmuCollateralToken(COLLATERAL_TOKEN).mint(address(this), type(uint128).max - 1)` — mint huge collateral
4. `IShezmuVault(SHEZMU_VAULT_PROXY).addCollateral(amount)` — deposit fake collateral
5. `IShezmuVault(SHEZMU_VAULT_PROXY).borrow(99999159998000000000000000000)` — borrow ShezUSD against fake collateral
6. Transfer borrowed ShezUSD to attacker EOA
**Exploitation:** Attacker minted ~3.4e38 collateral tokens for free, deposited them into the Shezmu Vault, then borrowed ~1e29 ShezUSD (worth ~$4.9M) against the worthless collateral and transferred the ShezUSD to their own address.
**Insight:** When a lending vault accepts a project-controlled collateral token, check whether that token's mint/burn functions are permissionless; a single missing onlyOwner on mint() turns into unlimited borrowing.
