# Collateral can not be properly retired by making its sharesRegistry inactive

Deactivating a collateral's sharesRegistry to retire it also blocks liquidations, repayments and withdrawals, locking user funds and bad debt.

- Payout: Contest reward
- Severity: medium
- Program: Jigsaw
- Credited: Chinmay Farkya
- Disclosed: 2025-08-11
- Write-up quality: 6/10
- Original: https://cdn.cantina.xyz/reports/cantina_competition_jigsaw_june2025.pdf#3.2.10
- Library page: https://bugbountylibrary.com/r/cantina%3Ajigsaw_june2025%3A3.2.10
- Tags: domain:web3 impact:dos impact:funds-loss kind:contest platform:cantina sev:medium technique:source-review vuln:access-control vuln:business-logic vuln:liquidation

**Target:** StablesManager / StrategyManager collateral registry checks
**Root cause:** isRegistryActive is enforced on exit paths (liquidate, repay, withdraw, claimInvestment) in addition to entry paths, so setting a registry inactive freezes all operations on existing positions instead of only blocking new deposits.
**Steps:**
1. Whitelist a collateral and its sharesRegistry in StablesManager (active).
2. Admin sets the registry inactive to retire the collateral.
3. Call `liquidate()`/`liquidateBadDebt()` → `forceRemoveCollateral()` reverts on inactive registry.
4. Call `repay()` → reverts on `isRegistryActive` check.
5. Call `withdraw()` → `removeCollateral()` reverts on inactive registry.
6. Call `StrategyManager.claimInvestment()` → `forceRemoveCollateral()`/`addCollateral()` reverts, blocking strategy withdrawals.
**How found:** Code review of the collateral lifecycle: traced the intended retire-by-deactivation feature and found isRegistryActive guards applied uniformly across exit functions, contradicting the stated purpose.
**Escalation:** If a collateral depegs or is compromised, admins cannot disable it without also freezing liquidations and repayments, accumulating bad debt and making JUSD worthless.
**Insight:** When a protocol has a 'sunset/retire' flag, enumerate every call site of that flag and check whether exit/liquidation paths are gated too — lifecycle flags commonly over-block and freeze funds.
