Closed code423n4 closed 1 year ago
0xSorryNotSorry marked the issue as primary issue
Sidu28 marked the issue as sponsor disputed
This is by design. Many competitors confused slashing and delays in withdrawals, which may have contributed to this issue being submitted. Stakers who have never delegated should not ever be subject to freezing. Freezing occurs (as an action) on the operator level, and operators are considered delegated to themselves, so the only way a staker can be frozen is if they are also an operator (in which case delegated to themselves) or else delegated to an operator. We will try to improve our docs on this.
GalloDaSballo marked the issue as unsatisfactory: Invalid
Closing per the sponsors comment, only delegated shares can be slashed
Lines of code
https://github.com/code-423n4/2023-04-eigenlayer/blob/main/src/contracts/core/StrategyManager.sol#L536-L579 https://github.com/code-423n4/2023-04-eigenlayer/blob/main/src/contracts/core/Slasher.sol#L115-L121 https://github.com/code-423n4/2023-04-eigenlayer/blob/main/src/contracts/core/Slasher.sol#L250-L256
Vulnerability details
canSlash
checks to see if the block number is less than_whitelistedContractDetails[toBeSlashed][slashingContract]
, which will be0
if a user has not delegated an address. This will revertfreezeOperator
and not allow an owner/watcher to freeze the address, and thus will not be able to slash a queued withdraw. This means, a user may act maliciously, and then wait the full 7 days before doing a full proper withdraw. In the meantime, they cannot be slashed.Proof of Concept
Within
StrategyManagerUnit.t.sol
, add the following lines to the bottom of the script. As we cannot freeze the user,slashQueuedWithdrawal
will fail to do its intended job.Recommended Mitigation
Either make it so
delegatedAddress = msg.sender
upon staking, or alter thecanSlash
function such that you can freeze the0
address. Note, if you freeze the0
address, it will impact all users who have not delegated their shares, and not just the malicious actor.Assessed type
Invalid Validation