Changing the slashingHandler for NativeVaults will DoS slashing
NativeVault's slashAssets function requires the slashingHandler argument to equal the vault's stored slashStore, but the Core allowlist can be updated to a new handler, so existing NativeVaults then always revert when slashed. An attacker or admin action of changing the handler could block slashing for all previously deployed NativeVaults until they are individually upgraded or the old handler is restored.
Submitted by givn, also found by sl1
Relevant code: NativeVault::slashAssets
Description
Core’s state contains a mapping between assets and slashingHandlers - assetSlashingHandlers. Assets that are assigned a slashing handler are considered whitelisted and vaults containing this asset can be deployed.
When a slash is performed on a vault, the following function is called:
function slashAssets(
uint256 slashPercentageWad, address slashingHandler
) external returns (uint256 transferAmount);
Inside NativeVault’s implementation of the function, the following check is performed:
if (slashingHandler != self.slashStore) revert NotSlashStore();
This check can be problematic in the case where some number of native vaults have been deployed and the assetSlashingHandlers mapping gets updated with a new slashHandler. Then, the slashAssets function will always revert.
Root Cause
Unsynchronized state update causes DoS of slashing functionality inside NativeVault.
Impact
If the slashingHandler for restaking gets changed at some point it will cause DoS of the slashing functionality for NativeVaults. It will be blocked until contracts get updated with new implementation or old slashing handler is restored.
The issue could be exacerbated if some new
NativeVaultsget deployed with the new slash handler. Then, reverting to the old slash handler will break the newly deployedNativeVaults, making update implementation the only option to fix this issue. But this is also troublesome because only normalVaultscan have they’re implementation updated for all deployments with one call.NativeVaultswould have to be updated one by one.
Proof of Concept
Let’s suppose the following scenario:
- SlashHandler
Ais set for keyConstants.DEAD_BEEFinassetSlashingHandlers. - 5
NativeVaultsget deployed with this slash handler. - SlashHandler
Bis set forConstants.DEAD_BEEF. - These 5
NativeVaultswould not be slashable until some measures are taken - eitherArestored or the vault’s implementations are updated.
Both approaches to fix this issue once it has occurred have their drawbacks:
- If after step 3, more
NativeVaultsare created updating the allowlist will always cause some group of native vaults to be unslashable. - Changing the
NativeVaultimplementations can only be done only 1 by 1, since the default vault implementation is for normalVault.
Suggested Mitigation
There are multiple ways to prevent this issue:
- Function only callable by
Managerto changeslashStore - Function in
Corethat is callable by anyone which changes the underlyingslashStoreof aNativeVaultif there is a difference. Allowing users to unDoS themselves. - Remove the check causing the revert in
slashAssetsand allowNativeVaultsto have differentslashHandlersif this is acceptable.
While technically valid, will need to confirm with the sponsor if slashing handlers are meant to be changed or if
allowlistAssets()is just meant to set the slashing handler once.
karan-andalusia (Karak) confirmed
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the vault stores its own slashStore at deployment while Core's assetSlashingHandlers mapping can be changed independently, and slashAssets requires the two to match.
Impact
Slashing for affected NativeVaults is blocked until the old handler is restored or each vault is upgraded, and if new vaults are deployed with the new handler, reverting breaks those instead.
What the attacker needed
Slashing handler is changed in Core allowlist; NativeVaults already deployed with old handler
The fix
The report suggests restricting slashStore changes to the Manager, adding a Core function anyone can call to sync a NativeVault's slashStore, or removing the equality check.
How it was found
- A slashing handler A is set for an asset key in the Core allowlist.
- Five NativeVaults are deployed with that handler.
- The allowlist is updated to a new slashing handler B for the same asset.
- The five NativeVaults can no longer be slashed until handler A is restored or each vault's implementation is updated.
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.
A vault is a contract that holds users' funds and can be penalised (slashed) if the operator misbehaves. The vault checks that the penalty is applied by the exact handler contract it was set up with, but a central list can later point to a different handler, so the check fails and no penalty can be applied. This means the slashing feature stops working for those vaults.
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.