Submitted by KupiaSec
https://github.com/code-423n4/2024-07-karak/blob/main/src/NativeVault.sol#L126-L162
https://github.com/code-423n4/2024-07-karak/blob/main/src/NativeVault.sol#L476-L495
https://github.com/code-423n4/2024-07-karak/blob/main/src/NativeVault.sol#L517-L525
https://github.com/code-423n4/2024-07-karak/blob/main/src/NativeVault.sol#L507-L515
The staker can still receive rewards even if their validators are empty.
Lets consider the following scenario:
The problem arises in step 6. Here, the shares being burned correspond to 32 ETH, while Alices 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.
The _decreaseBalance() function should be enhanced to properly handle cases where the burning amount exceeds the existing share amount.
For example:
MiloTruck (judge) decreased severity to Medium and commented:
MiloTruck (judge) commented:
karan-andalusia (Karak) confirmed
Karak mitigated:
Status: Mitigation confirmed. Full details in reports from 0xCiphky, sl1 (1, 2) and KupiaSec.
