# Unstaking calculates user share at request time, ignoring slashing — leading to DoS and unfair distribution

Cabal locks unstake payout at request time, so slashing during unbonding lets early/whale claimers overclaim, DoSing pool or shifting loss to others.

- Payout: Contest reward
- Severity: medium
- Program: Cabal
- Credited: 0xAlix2
- Disclosed: 2025-05-28
- Write-up quality: 6/10
- Original: https://code4rena.com/reports/2025-04-cabal-liquid-staking-token#m-02
- Library page: https://bugbountylibrary.com/r/c4%3A2025-04-cabal-liquid-staking-token%3AM-02
- Tags: domain:web3 impact:dos impact:funds-loss kind:contest platform:code4rena sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:business-logic vuln:dos

**Target:** Move staking/unstaking module (cabal.move)
**Root cause:** process_lp_unstake/process_xinit_unstake compute the claimable amount from pool value at unstake time and store it in UnbondingEntry; claim_unbonded_assets transfers that fixed amount without recomputing against post-slash pool value.
**Steps:**
1. User calls `initiate_unstake` → `process_lp_unstake` computes `unbonding_amount = ratio(unstake_amount, cabal_lp_amount) * (reward_amount + get_real_total_stakes)` and stores it in `UnbondingEntry`.
2. During unbonding, validator slashing reduces `get_real_total_stakes`.
3. After unbonding, user calls `claim_unbonded_assets`, which transfers the stored `amount` blindly via `primary_fungible_store::transfer`.
4. If stored amount exceeds remaining pool (whale case), transfer reverts/breaks accounting; if early user, they claim full pre-slash value and remaining users absorb the loss.
**How found:** Code review of unstake flow: noticed claimable amount computed at request time and blindly transferred at claim, contrasted with Lido-style share-based claim-time computation, then modeled slash scenarios.
**Exploitation:** A whale unstaking ~50% of pool locks a pre-slash claim; a subsequent 51% slash leaves pool below the stored claim, causing claim revert/DoS. Alternatively an early claimer extracts full pre-slash value, leaving later stakers to absorb the entire slash.
**Insight:** In staking/unbonding designs, check whether the payout is a fixed amount or a share of pool; any value stored at request time that depends on a mutable pool balance (slashing, rewards, donations) is a fairness/DoS vector.
