# Steal collateral during `end` process, by earning DSR interest after `flow`.

MakerDAO end.cage fails to cage the pot (DSR) contract, letting users keep minting DAI after end.flow fixes the rate and drain all collateral.

- Payout: hidden
- Severity: high
- Program: BlockDev Sp. Z o.o
- Found by: lucash-dev
- Disclosed: 2019-09-09
- Write-up quality: 8/10
- Original: https://hackerone.com/reports/672664
- Library page: https://bugbountylibrary.com/r/h1%3A672664
- Tags: area:web3 domain:web3 impact:funds-loss impact:integrity kind:bounty platform:hackerone sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** MCD_END / pot (DSR) smart contracts
**Root cause:** end.cage() cages vat but never cages the pot contract, so pot.drip keeps accruing DSR interest and minting new DAI even after end.flow fixes the DAI/collateral redemption rate.
**Steps:**
1. Initiate shutdown: end.cage() cages vat (no new CDPs, no vat.fold) but leaves pot live.
2. end.flow() fixes the DAI/ETH redemption rate.
3. Deposit DAI into pot and let pot.drip accrue interest, minting new DAI beyond the pre-flow supply.
4. Call pot.exit to withdraw inflated DAI balance.
5. Call end.pack then end.cash to redeem inflated DAI for collateral, draining more than the depositor's share.
6. Later redeemers find no collateral left and their end.cash calls fail.
**How found:** Reading end.cage and noticing it cages vat but not pot; hypothesized DSR interest could keep minting DAI after the rate was fixed at end.flow, then wrote a Foundry test (test_steal_collateral_using_dsr_after_thaw) to confirm.
**Exploitation:** After end.flow fixes the rate, an attacker deposits DAI in pot, waits for DSR interest to accrue (minting new DAI), exits, then packs and cashes out the inflated DAI for collateral, taking collateral owed to slower redeemers.
**Escalation:** Passive DSR depositors (e.g. Dapps holding DAI for months) unwittingly inflate supply and steal collateral without intent; worst case ~10%+ of collateral lost with 20% DSR and most DAI locked in Dapps.
**Insight:** When auditing shutdown/migration flows, enumerate every contract that can mint or accrue value (pot, jug, vat) and verify each is caged; a single uncaged minter after the rate is fixed lets an attacker dilute redemption claims.

