# If minimumCollateralization is increased, claimRedemption() will be DoSed because of under- flow

AlchemistV3 redeem() subtracts debt-scaled collateral from _totalLocked without underflow guard; raising minimumCollateralization drains it to zero, DoSing claimRedemption().

- Payout: Contest reward
- Severity: medium
- Program: Alchemix
- Credited: BenRai
- Disclosed: 2025-07-15
- Write-up quality: 6/10
- Original: https://cdn.cantina.xyz/reports/cantina_competition_alchemix_may2025.pdf#3.2.3
- Library page: https://bugbountylibrary.com/r/cantina%3Aalchemix_may2025%3A3.2.3
- Tags: domain:web3 impact:dos kind:contest platform:cantina sev:medium tech:evm tech:solidity technique:incomplete-fix technique:source-review vuln:accounting-error vuln:dos

**Target:** AlchemistV3 / Transmuter redemption accounting
**Root cause:** _addDebt locks amount*minimumCollateralization into _totalLocked, but redeem() subtracts convertDebtTokensToYield(amount)+fee from _totalLocked with no underflow clamp (unlike _subDebt). If minimumCollateralization rises between mint and redeem, more is removed than was added.
**Steps:**
1. Deploy AlchemistV3 + Transmuter with minimumCollateralization = 1e36/9e17 (~1.11).
2. As user 0xbeef: `alchemist.deposit(100e18,...)` then `alchemist.mint(tokenId, totalValue*1e18/minimumCollateralization, ...)`.
3. Admin calls `alchemist.setMinimumCollateralization(1e36/88e16)` (88%, higher).
4. User `alchemist.burn(alTokenBalance/2, tokenId)` — _subDebt clamps toFree to _totalLocked, zeroing it.
5. User `transmuter.createRedemption(alTokenBalance/2)`, roll forward past timeToTransmute.
6. `transmuter.claimRedemption(1)` reverts with Panic(0x11) underflow in redeem().
**How found:** Code reading of _addDebt/_subDebt/redeem: noticed _subDebt clamps toFree against _totalLocked but redeem() does raw `_totalLocked = old - totalOut`, then reasoned that a parameter change between mint and burn makes deductions exceed additions.
**Insight:** When a global accumulator is incremented using a mutable parameter, check every decrement path for the same parameter being read at a different time — asymmetric clamping (one path guarded, another not) is the tell.
