Skip to content
Business logic Audit finding Advanced

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.

Cyfrin Follow with Josiah, QiuhaoLi and 1 other

Originally disclosed on Code4rena

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:

  1. Alice stakes 32 ETH and gets corresponding shares in BeaconEthStrategy.
  2. 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.
  3. An observer will submit a proof via EigenPod::verifyOverCommittedStake and Alice’s shares are now decreased to 0 (Note: this will be credited back to Alice when she withdraws from the Beacon Chain using EigenPod::verifyAndProcessWithdrawal).
  4. Next, Alice’s operator gets slashed and her account gets frozen.
  5. Governance slashes Alice, along with all stakers who delegated to slashed operator (there is nothing to slash since Alice’s shares are currently 0).
  6. After slashing everyone, governance resets frozen status of operator by calling ISlasher::resetFrozenStatus.
  7. Alice now unstakes on the Beacon Chain and gets a credit of shares that were earlier deducted while recording over-commitment.
  8. 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


The original report as published on Code4rena, by Cyfrin. 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.

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

  1. Alice stakes 32 ETH and receives shares in BeaconEthStrategy.
  2. Alice is slashed on the Beacon Chain and her balance falls below the restaked amount.
  3. An observer submits an over-commitment proof and Alice's shares are reduced to zero.
  4. Alice's operator is slashed and her account is frozen.
  5. Governance slashes Alice and other stakers, but there are no shares to slash.
  6. 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.

More by Cyfrin

View all

3 more disclosed reports, best first.

More from EigenLayer Contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.