A snapshot may face a permanent DoS if both a slashing event occurs in the NativeVault and the staker’s validator is penalized
A snapshot update could try to burn more shares than the staker owns when a slashing event plus a beacon chain penalty exceeds the staker's balance, causing the transaction to revert. This permanently blocks snapshot validation for that staker, so they keep receiving rewards despite an empty validator.
The staker can still receive rewards even if their validators are empty.
Proof of Concept
Let’s consider the following scenario:
Alice has a validator whose balance is 32 ETH.
A slashing event occurs in the NativeVault, resulting in Alice being slashed by 2 ETH, reducing her withdrawable assets to 30 ETH.
Subsequently, Alice’s validator loses all its funds (this can happen within the 7-day snapshot period, even within just 1 hour). A snapshot should then be taken to reduce Alice’s assets by 32 ETH, which requires calling the validateSnapshotProofs() function for Alice’s validator.
The problem arises in step 6. Here, the shares being burned correspond to 32 ETH, while Alice’s shares only amount to 30 ETH. This discrepancy causes the burn amount to exceed the existing share amount, leading to a reversal of the transaction. As a result, the snapshot for Alice will be permanently DoSed, and her share amount will remain unchanged. Consequently, Alice can still receive rewards even though her validator is empty. In addition, nobody can call validateExpiredSnapshot() for Alice.
A malicious staker could intentionally orchestrate this scenario by creating a validator and engaging in malicious behavior. If the malicious action fails, they would lose all 32 ETH but could still receive rewards.
Recommended Mitigation Steps
The _decreaseBalance() function should be enhanced to properly handle cases where the burning amount exceeds the existing share amount.
Subsequently, Alice’s validator loses all its funds (this can happen within the 7-day snapshot period, even within just 1 hour). A snapshot should then be taken to reduce Alice’s assets by 32 ETH
2 — Med: Assets not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.
As stated in my initial comment, this requires both Karak and beacon chain slashing to occur. The upper limit of how much the DSS can slash an account for is 100%:
uint256 public constant HUNDRED_PERCENT_WAD = 100e18;
uint256 public constant MAX_SLASHING_PERCENT_WAD = HUNDRED_PERCENT_WAD;
Therefore, it is possible for the sum of Karak and beacon chain slashing to exceed 100%, however unlikely. I view this as “with stated assumptions, but external requirements”.
Regarding impact, validateSnapshotProofs() and validateExpiredSnapshot() will permanently be DOSed for the user - they can’t stake into the vault in the future even if they would like to. This fulfills “the function of the protocol or its availability could be impacted”.
This mitigation accounts for the decrease in balance of the users shares before burning.
Status: Mitigation confirmed. Full details in reports from 0xCiphky, sl1 (1, 2) and KupiaSec.
The original report as published on Code4rena, by KupiaSec. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Generating the AI write-up for this report.
This usually takes about 30 seconds. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
How it worked
Root cause
Likely the _decreaseBalance function burns shares for the full asset amount without capping the burn at the staker's actual share balance.
Impact
The snapshot for the affected staker is permanently blocked, so they keep receiving rewards despite an empty validator and cannot stake into the vault in future.
What the attacker needed
Karak slashes the operator; Beacon chain slashing also occurs; Combined slashing exceeds restaked balance
The fix
The _decreaseBalance function should cap the number of shares burned at the staker's actual share balance; the project mitigated this by accounting for the decrease in the user's shares before burning.
How it was found
Alice has a validator with 32 ETH.
A slashing event in the NativeVault reduces her withdrawable assets to 30 ETH.
Her validator then loses all funds within the snapshot period.
validateSnapshotProofs is called and sets the balance delta to -32 ETH.
_updateSnapshot calls _updateBalance with a negative total delta.
_decreaseBalance tries to burn shares worth 32 ETH, which exceeds Alice's 30 ETH of shares, so the transaction reverts.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Generating the AI write-up for this report.
This usually takes about 30 seconds. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
A staker's balance is tracked in shares. When a snapshot tries to reduce the balance by more than the staker actually has, the burn operation fails and the whole transaction reverts. Because the snapshot can never complete, the staker's old balance stays in place and they keep earning rewards even though their validator has no funds.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.