Skip to content
Business logic Audit finding Intermediate

Incorrect lidoLockedETH value can block full re

The vault's lidoLockedETH accounting does not clear fully when Lido returns less ETH than the stETH requested, so the locked amount accumulates and total assets are overstated. This can block full redemption of vault shares because the contract balance is lower than the calculated total assets.

MahdiKarimi Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

28689 - [SC - Medium] incorrect lidoLockedETH value can block full re...

Submitted on Feb 24th 2024 at 00:39:16 UTC by @MahdiKarimi for Boost | Puffer Finance

Report ID: #28689

Report type: Smart Contract

Report severity: Medium

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

Impacts:

  • Protocol insolvency

Description

Brief/Intro

since the claimed withdrawal amount from Lido is lower than the requested amount ( and lidoLockedETH ), it creates a situation in which lidoLockedETH is increased over time and leading to over-calculation of the vault share price.

Vulnerability Details

In most cases stETH is always cheaper than ETH, when a withdrawal request is initiated, the requested withdrawal amount is added to lidoLockedETH and claim withdrawal would subtract the claimed amount from lidoLockedETH, however since the claim amount is less than the requested withdrawal, so lidoLockedETH won't be cleared, lidoLockedETH is increased over time and since it's used to calculate total assets it would lead to over calculation of vault shares (puffETH), and would block full redeeming of vault shares since total assets > balance ( assuming there is no stake in eigen layer or withdraw queue ).

Impact Details

It has two impacts : since lidoLockedETH would increase over time with each withdrawal request it can effect contract calculations. 1 - full redeeming of puffETH gets blocked 2 - over calculation of total assets which inflates share price without backup reserve

References

Scenario : 1 - Alice deposits 10 ETH and receives 10 puffETH (considering she is the only depositor ) 2 - 10 ETH is staked on lido and after a time we have 11 stETH balance in the vault 3 - a withdraw request is initiated and 11 stETH is added to LidoLockedETH 4 - The lido withdrawal request is claimed and 10.999 ETH will be added to the contract balance and gets subtracted from LidoLockedETH 5 - now total assets = 10.999 ETH + 0.0001 lidoLockedETH = 11 ETH but contract balance is 10.999 ETH 6 - now if Alice decides to withdraw 10 puffETh, 10 vault shares = 11 ETH 7 - since contact doesn't have 11 ETH balance it can't fully repay Alice so she needs to redeem lower shares.

Proof of Concept

function test_lido_withdrawal_lidoLockedETH()
        public
        giveToken(BLAST_DEPOSIT, address(stETH), address(pufferVault), 2000 ether) // Blast got a lot of stETH
    {
        // Queue 2x 1000 ETH withdrawals on Lido
        uint256[] memory amounts = new uint256[](2);
        amounts[0] = 1000 ether; // steth Amount
        amounts[1] = 1000 ether; // steth Amount
        vm.startPrank(OPERATIONS_MULTISIG);
        uint256[] memory requestIds = pufferVault.initiateETHWithdrawalsFromLido(amounts);

        // Finalize all 2 withdrawals and fast forward to +10 days
        _finalizeWithdrawals(requestIds[1]);
        vm.roll(block.number + 10 days);

        // This one should work
        pufferVault.claimWithdrawalsFromLido(requestIds);

        // since there is no stake amount in lido, eigen layer and withdrawal request we expect total assets = balance 
        assertEq(address(pufferVault).balance, pufferVault.totalAssets();, 'balance of puffer vault is loweer than total assets'));
        
    }

The original report as published on Immunefi, by MahdiKarimi. 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 claim logic subtracts only the actual ETH received from lidoLockedETH instead of clearing the full requested stETH amount, leaving a residual that accumulates.

Impact

The inflated total assets could block full redemption of puffETH and overstate the share price without matching reserves, though the text assumes no stake in EigenLayer or withdrawal queue.

What the attacker needed

Vault holds stETH and initiates Lido withdrawals; Lido returns less ETH than stETH requested; no EigenLayer stake or withdrawal queue

The fix

The claim logic should clear the full requested stETH amount from lidoLockedETH, or otherwise reconcile the residual so total assets match the actual balance.

How it was found

  1. Alice deposits 10 ETH and receives 10 puffETH as the only depositor.
  2. The 10 ETH is staked on Lido and grows to 11 stETH in the vault.
  3. A withdrawal request is initiated and 11 stETH is added to lidoLockedETH.
  4. The Lido withdrawal is claimed, adding 10.999 ETH to the contract balance and subtracting that from lidoLockedETH.
  5. Total assets are now 10.999 ETH plus 0.0001 lidoLockedETH, which is 11 ETH, while the contract balance is only 10.999 ETH.
  6. Alice tries to withdraw 10 puffETH, which is valued at 11 ETH, but the contract cannot fully repay her.

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.

The vault keeps a running total of ETH it thinks is still tied up in a pending withdrawal from Lido. When the withdrawal completes, Lido pays back slightly less ETH than the stETH amount requested, but the vault only subtracts the smaller amount, so the leftover stays on the books forever. Over time the vault believes it holds more than it really does, so users cannot always redeem their full share.

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 MahdiKarimi

View all

11 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.