Skip to content
Business logic Audit finding Advanced

EigenLayers share rate can be massively inflate

The PufferVault contract's depositToEigenLayer function does not check the number of shares returned when depositing into EigenLayer, so a griefing attack that inflates EigenLayer's share rate could cause the vault to receive fewer shares than expected. This could lead to a loss of shares for users.

Shaheen Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

28612 - [SC - Insight] EigenLayers share rate can be massively inflate...

Submitted on Feb 22nd 2024 at 14:10:16 UTC by @Shaheen for Boost | Puffer Finance

Report ID: #28612

Report type: Smart Contract

Report severity: Insight

Target: https://etherscan.io/address/0xd9a442856c234a39a81a089c06451ebaa4306a72

Impacts:

  • Griefing (e.g. no profit motive for an attacker, but damage to the users or the protocol)
  • Inadequate Integration

Description

Brief/Intro

Griefing attacks can significantly inflate EigenLayer's share rate, potentially leading to a reduction in shares received by the PufferVault.

Vulnerability Details

Puffer is integrating EigenLayer. The PufferVault contract's depositToEigenLayer() function is utilized to deposit users' assets into the Eigenlayer Strategy. However, it lacks a mechanism to ensure that the expected shares are returned, which can result in loss of shares for the users.

Solidity
    function depositToEigenLayer(uint256 amount) external virtual restricted {
        SafeERC20.safeIncreaseAllowance(_ST_ETH, address(_EIGEN_STRATEGY_MANAGER), amount);
        ///@audit-issue slippage protection should be added because "share rate can be massively inflated" ~ EigenLayer
        _EIGEN_STRATEGY_MANAGER.depositIntoStrategy({ strategy: _EIGEN_STETH_STRATEGY, token: _ST_ETH, amount: amount });
    }

The EigenLayer's depositIntoStrategy()/deposit() function is susceptible to griefing attacks, as highlighted in their C4 audit (1). While EigenLayer acknowledges this issue (2), their mitigation approach is to verify that the returned shares are not zero, considering it as a worst-case scenario when the share rate is "massively inflated"

Solidity
->    // extra check for correctness / against edge case where share rate can be massively inflated as a 'griefing' sort of attack
      require(newShares != 0, "StrategyBase.deposit: newShares cannot be zero");

EigenLayer does not implement slippage protection within this function for not so "massive" inflation attacks, leaving it to the discretion of strategy designers. Strategy designers are advised to incorporate slippage protection into their implementations, as discussed in their audit findings (3):

This is good information for Strategy designers - EigenLayer Dev

To clarify, EigenLayer addresses scenarios where a griefing attack is significant enough to reduce shares to zero. However, it does not handle situations where the attack results in a much smaller number of shares, such as 25-50, when the expected output was 100 shares.

Impact Details

  • Loss of Shares

Recommended Mitigation

EigenLayer depends on this shares numbers so much (delegation & withdrawals specifically), so it is very important that users/protocol receive maximum/expected shares.

To enhance security for the users'/protocol's funds, it is recommended to add a slippage protection mechanism using minShares:

Solidity
    function depositToEigenLayer(uint256 amount, uint256 minShares) external virtual restricted {
        SafeERC20.safeIncreaseAllowance(_ST_ETH, address(_EIGEN_STRATEGY_MANAGER), amount);
        uint256 shares = _EIGEN_STRATEGY_MANAGER.depositIntoStrategy({ strategy: _EIGEN_STETH_STRATEGY, token: _ST_ETH, amount: amount });
        require(shares >= minShares, "Slippage Protected");
    }

References

https://github.com/code-423n4/2023-04-eigenlayer-findings/issues/343 https://github.com/Layr-Labs/eigenlayer-contracts/blob/d80482086a8391be7a7bbf3fb1287a68b338cc73/src/contracts/strategies/StrategyBase.sol#L118 https://github.com/code-423n4/2023-04-eigenlayer-findings/issues/343#issuecomment-1545067086

Proof of Concept

Regrettably, due to the nature of this issue being specific to griefing attacks on EigenLayer, I find it challenging to construct a Coded Proof of Concept (PoC). I hope that the protocol team and triagers will comprehend this limitation. Thank you for your understanding.

The original report as published on Immunefi, by Shaheen. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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 deposit function lacks a minimum-shares slippage check, so it accepts whatever share amount EigenLayer returns even if inflated share rate reduces it.

Impact

Users could receive fewer shares than expected, leading to a loss of shares, though the attack is a griefing one with no direct profit motive.

What the attacker needed

Attacker can inflate EigenLayer share rate; PufferVault deposits into EigenLayer

The fix

The deposit function should be fixed by adding a minimum-shares parameter and requiring the returned shares to be at least that amount.

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.

When you deposit money into a shared pool, you get 'shares' that represent your portion. If someone can manipulate the pool's accounting so that each share becomes very valuable, your deposit might buy fewer shares than it should. This report says the vault doesn't check how many shares it gets back, so a malicious actor could cause it to receive too few.

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 Shaheen

View all

2 more disclosed reports, best first.

More from Puffer Finance

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.