Skip to content
Access control Audit finding Intermediate

The function claimWithdrawalFromEigenLayer can

The claimWithdrawalFromEigenLayer function is documented as restricted but lacks the restricted modifier, so anyone can call it. An attacker could trigger the claim of a queued withdrawal, potentially causing theft of unclaimed yield or protocol insolvency.

crazy_squirrel Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

28773 - [SC - Insight] The function claimWithdrawalFromEigenLayer can ...

Submitted on Feb 26th 2024 at 18:37:32 UTC by @crazy_squirrel for Boost | Puffer Finance

Report ID: #28773

Report type: Smart Contract

Report severity: Insight

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

Impacts:

  • Theft of unclaimed yield
  • Protocol insolvency

Description

Brief/Intro

The claimWithdrawalFromEigenLayer function in the PufferVault is marked as restricted in the NatSpec comment.

However, it doesn't have the appropriate restricted modifier, and can be called by anyone instead.

Vulnerability Details

claimWithdrawalFromEigenLayer

Solidity
function claimWithdrawalFromEigenLayer(
    IEigenLayer.QueuedWithdrawal calldata queuedWithdrawal,
    IERC20[] calldata tokens,
    uint256 middlewareTimesIndex
) external virtual;

Completes the process of withdrawing stETH from EigenLayer's stETH strategy contract

Effects

  • Claims the previously queued withdrawal from EigenLayer's stETH strategy contract
  • Transfers stETH from EigenLayer's stETH strategy contract to this vault contract

Requirements

  • There must be a corresponding queued withdrawal created previously via function initiateStETHWithdrawalFromEigenLayer
  • Enough time must have elapsed since creation of the queued withdrawal such that it is claimable at the time of this function call

Impact Details

Provide a detailed breakdown of possible losses from an exploit, especially if there are funds at risk. This illustrates the severity of the vulnerability, but it also provides the best possible case for you to be paid the correct amount. Make sure the selected impact is within the program’s list of in-scope impacts and matches the impact you selected.

References

https://github.com/PufferFinance/pufETH/blob/d340d40a2ebb72993cd7dd6049a78a01bcef32ae/src/PufferVault.sol#L217

Proof of Concept

The original report as published on Immunefi, by crazy_squirrel. 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 missing restricted modifier on the claimWithdrawalFromEigenLayer function, despite the NatSpec stating it is restricted.

Impact

An attacker could call the function to claim a queued withdrawal, potentially leading to theft of unclaimed yield or protocol insolvency.

What the attacker needed

A queued withdrawal must exist; enough time must have elapsed

The fix

The function should be fixed by adding the restricted modifier to enforce access control.

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.

A smart contract function is supposed to be limited to certain trusted users, but the code forgot to add the check that enforces this. That means any user can call it, which might let them interfere with withdrawals and cause financial loss.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by crazy_squirrel

View all

1 more disclosed report, 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.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.