A staker with verified over-commitment can potentially bypass slashing completely
A staker whose shares were reduced to zero by an over-commitment proof can later have those shares credited back after slashing, avoiding any penalty. An attacker could therefore escape slashing by timing a beacon chain unstake after the operator is unfrozen.
Submitted by Cyfrin, also found by Josiah, QiuhaoLi, and RaymondFam
https://github.com/code-423n4/2023-04-eigenlayer/blob/5e4872358cd2bda1936c29f460ece2308af4def6/src/contracts/core/StrategyManager.sol#L197 https://github.com/code-423n4/2023-04-eigenlayer/blob/5e4872358cd2bda1936c29f460ece2308af4def6/src/contracts/core/StrategyManager.sol#L513
In EigenLayer, watchers submit over-commitment proof in the event a staker’s balance on the Beacon chain falls below the minimum restaked amount per validator. In such a scenario, stakers’ shares are decreased by the restaked amount. Note, that when a full withdrawal is processed, stakers’ deducted shares are credited back to allow for a planned withdrawal on EigenLayer
If such a staker has delegated to an operator who gets slashed on EigenLayer, there is a possibility that this staker completely bypasses any slashing penalties. If overcommitment reduced the shares in the stakers account to 0, there is nothing available for governance to slash.
It is reasonable to assume that governance calls StrategyManager::slashShares to reduce a percentage of shares (penalty) from all stakers who delegated to a slashed operator and then resets the frozen status of operator by calling ISlasher::resetFrozenStatus.
By simply unstaking on the beacon chain AFTER slashing is complete (and operator is unfrozen), an over-committed staker can simply unstake on beacon chain and get back their shares that were deducted when over-commitment was recorded (refer to PoC). Note: these shares have not faced any slashing penalties.
An over-committed staker can avoid being slashed in a scenario, in which their stake should be subject to slashing and so we evaluate the severity to MEDIUM.
Proof of Concept
Consider the following scenario with a chain of events in this order:
- Alice stakes 32 ETH and gets corresponding shares in
BeaconEthStrategy. - After some time, Alice gets slashed on the Beacon Chain and her current balance on the Beacon Chain is now less than what she restaked on EigenLayer.
- An observer will submit a proof via
EigenPod::verifyOverCommittedStakeand Alice’s shares are now decreased to 0 (Note: this will be credited back to Alice when she withdraws from the Beacon Chain usingEigenPod::verifyAndProcessWithdrawal). - Next, Alice’s operator gets slashed and her account gets frozen.
- Governance slashes Alice, along with all stakers who delegated to slashed operator (there is nothing to slash since Alice’s shares are currently 0).
- After slashing everyone, governance resets frozen status of operator by calling
ISlasher::resetFrozenStatus. - Alice now unstakes on the Beacon Chain and gets a credit of shares that were earlier deducted while recording over-commitment.
- Alice queues a withdrawal request and completes the withdrawal, without facing any slashing penalty.
Recommended Mitigation Steps
Over-commitment needs to be accounted for when slashing, such that a staker is being slashed; not just shares in their account, but also the amount that is temporarily debited while recording over-commitment.
Consider adding a mapping to StrategyManager that keeps track of over-commitment for each staker and take that into consideration while slashing in StrategyManager::slashShares.
Alex the Entreprenerd (judge) commented:
The Warden has shown how, due to an incorrect assumption, it’s possible for an over-commited staker to avoid a slashing.
The finding requires multiple external requirements:
- Being over-commited (perhaps inactivity leak or ETH2 slashing).
- Having delegated to an operator that will be slashed.
For these reasons I agree with Medium Severity.
Sidu28 (EigenLayer) confirmed via duplicate issue 210
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 slashing logic only looks at current shares and ignores shares temporarily debited during over-commitment recording, so those shares are later credited back unpenalised.
Impact
An over-committed staker could completely bypass slashing penalties, but only if they have already been over-committed and their operator is later slashed.
What the attacker needed
Staker is over-committed; delegated to an operator that gets slashed; governance slashes after over-commitment; operator is unfrozen before withdrawal
The fix
Slashing should account for over-commitment by tracking the temporarily debited amount per staker and including it when calculating penalties.
How it was found
- Alice stakes 32 ETH and receives shares in BeaconEthStrategy.
- Alice is slashed on the Beacon Chain and her balance falls below the restaked amount.
- An observer submits an over-commitment proof and Alice's shares are reduced to zero.
- Alice's operator is slashed and her account is frozen.
- Governance slashes Alice and other stakers, but there are no shares to slash.
- After the operator is unfrozen, Alice unstakes on the Beacon Chain, receives credited shares, and withdraws without penalty.
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.
In this staking system, if a staker's real balance falls below what they promised, their recorded shares are set to zero. Later, when they withdraw, those shares are given back. The report shows that if they wait until after a slashing event, they get the shares back without ever paying the penalty.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.