Submitted by 0xAlix2, also found by adam-idarrha, givn, maxzuvex, and TheSchnilch
https://github.com/code-423n4/2025-04-cabal/blob/main/sources/cabal.move#L1075-L1080
https://github.com/code-423n4/2025-04-cabal/blob/main/sources/cabal.move#L1017-L1022
Users can stake both INIT and LP tokens into different validator pools by calling functions like deposit_init_for_xinit or stake_asset. To exit, users initiate an unstake via initiate_unstake, which starts an unbonding period. After this delay, they can claim their tokens through claim_unbonded_assets.
Behind the scenes, these staked assets are delegated to validators, and slashing may occurmeaning a portion of the delegated tokens could be penalized (burned). To stay accurate, the protocol uses pool_router::get_real_total_stakes to track the current delegated amount. However, the current unstaking flow doesnt properly account for slashing events that may occur during the unbonding period.
When a user initiates an unstake, either process_lp_unstake or process_xinit_unstake is called. For simplicity, we focus on process_lp_unstake.
In process_lp_unstake, the claimable amount is calculated up front at unstake time:
Later, in claim_unbonded_assets, this precomputed amount is blindly transferred to the user:
This design introduces a critical flaw: it assumes the pool value remains constant between unstake and claim, which is not guaranteed. If slashing happens during this period:
NB:
This differs from systems like Lido, where the amount returned is computed at claim time based on the users share of the pool, ensuring fair slashing distribution.
Instead of locking in the claimable amount at unstake time, store the users percentage share of the total LP supply. Then, during claim_unbonded_assets, recalculate the actual amount using the current pool value (i.e., post-slash).
This ensures slashing risk is shared proportionally among all stakers, and prevents DoS or overclaiming exploits.
Case 1  Whale Unstakes 50%, Then Pool Is Slashed by 51%
Scenario:
Current behavior (problem):
What should happen:
Case 2  Early User Unstakes, Pool Slashed, Claims Full Amount
Scenario:
Current behavior (problem):
What should happen:
