# A snapshot may face a permanent DoS if both a slashing event occurs in the NativeVault and the staker's validator is penalized

Karak NativeVault burns shares for full beacon-chain slashing delta, exceeding staker's remaining shares, reverting snapshot validation and permanently DoSing snapshot finalization.

- Payout: Audit contest
- Severity: medium
- Program: Karak
- Found by: KupiaSec
- Disclosed: 2024-10-07
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-07-karak-findings/issues/31
- Library page: https://bugbountylibrary.com/r/c4%3A2024-07-karak%3AM-02
- Tags: area:web3 domain:web3 impact:dos kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:dos

**Target:** NativeVault.sol snapshot validation and balance decrease logic
**Root cause:** _decreaseBalance burns shares computed from the full asset delta without capping at the staker's actual share balance; when Karak slashing plus beacon-chain slashing exceeds total restaked ETH, _burn reverts.
**Steps:**
1. Staker has validator with 32 ETH restaked in NativeVault.
2. Karak slashes staker by 2 ETH, reducing withdrawable assets to 30 ETH.
3. Beacon chain slashes validator's full balance (32 ETH) within snapshot period.
4. Call `validateSnapshotProofs()` with balance proof showing -32 ETH delta.
5. `_updateSnapshot()` computes totalDeltaWei = -32 ETH and calls `_updateBalance()`.
6. `_decreaseBalance()` calls `previewWithdraw(32 ETH)` and `_burn(_of, shares)` where shares > staker's 30 ETH worth of shares, reverting.
7. Snapshot remains stuck; `validateExpiredSnapshot()` also cannot proceed.
**How found:** Code review of snapshot balance update path: noticed _decreaseBalance burns shares based on asset delta without checking against actual share balance, and reasoned that combined slashing exceeding total restaked ETH would cause underflow/revert.
**Exploitation:** A malicious staker could intentionally get slashed by both Karak and the beacon chain to exceed their restaked balance, permanently blocking snapshot finalization for their node while still earning rewards on the un-updated share balance.
**Insight:** When a protocol mirrors an external slashing delta into internal share accounting, check whether the burn amount can exceed the user's current share balance after prior partial slashing; cap burns at balanceOf to avoid permanent DoS.

