Skip to content
Business logic Audit finding Intermediate

Stuck `stETH` rewards in queue contracts

The queue contracts are not compatible with rebasing tokens like stETH, so when stETH rewards accrue, the extra balance remains stuck in the queue. An attacker could potentially exploit this to cause loss of funds or disrupt operations.

0rpse Follow with 0xc0ffEE and klaus

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-07-mellow-flexible-vaults-judging/issues/739

This issue has been acknowledged by the team but won't be fixed at this time.

Found by

0rpse, 0xc0ffEE, klaus

Summary

stETH rewards can be stuck in queue contracts because the contracts are not compatible with rebasing tokens, specifically stETH.

Root Cause

The system integrates with stETH but the implementation is not compatible with stETH (since stETH is rebase token). For example with the contract DepositQueue

  1. At request deposit phase, assets amount of stETH is sent from depositor to the queue
  2. The request then needs to wait for deposit interval and oracle timeout
  3. When oracle reports valid price, the amount assets at step (1) is sent from queue to the vault

Indeed, within the time period in step (2) above, Lido system can report rewards (happening daily, positive or negative) and the stETH share price increases in case positive, resulting the queue's stETH balance increases to be more than assets. So, this means that the reward part is not accounted by the queue

Oppositely, in negative case, the queue's stETH balance can decrease causing it is unable to execute the step (3) (although Lido claims that the negative case has not happened).

Note: the issue can also happen with other contracts which holds funds, such that RedeemQueue, Vault

Internal Pre-conditions

NA

External Pre-conditions

NA

Attack Path

(Example above)

Impact

  • stETH rewards are unhandled, leaving it stuck in the contract

PoC

Using this MockRebaseERC20 as mock for stETH

Solidity
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.25;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract MockRebaseERC20 is ERC20 {
    constructor() ERC20("MockERC20", "ME20") {}

    uint256 sharePrice = 1e18;

    uint256 constant DENOM = 1e18;

    function setSharePrice(uint256 newValue) public {
        sharePrice = newValue;
    }

    function toShares(uint256 value) public view returns (uint256 shares) {
        shares = value * DENOM / sharePrice;
    }

    function balanceOf(address account) public view override returns (uint256) {
        return (super.balanceOf(account) * sharePrice / DENOM);
    }

    function mint(address to, uint256 shares) external {
        _mint(to, shares);
    }

    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal override {
        super._approve(owner, spender, toShares(value), emitEvent);
    }

    function _update(address from, address to, uint256 value) internal override {
        value = toShares(value);
        super._update(from, to, value);
    }
}

Add the test test_stETH below to the test file test/unit/queues/DepositQueue.t.sol

Solidity
    function test_stETH() public {
        skip(30 days);

        delete assetsDefault;
        asset = address(new MockRebaseERC20());
        assetsDefault.push(asset);

        Deployment memory deployment = createVault(vaultAdmin, vaultProxyAdmin, assetsDefault);
        DepositQueue queue = DepositQueue(addDepositQueue(deployment, vaultProxyAdmin, asset));
        IOracle.SecurityParams memory securityParams = deployment.oracle.securityParams();

        address alice = makeAddr('alice');
        pushReport(deployment.oracle, IOracle.Report({asset: asset, priceD18: 1e18}));
        uint nextReportTs = block.timestamp + securityParams.timeout;

        skip(1);
        makeDeposit(alice, 10 ether, queue);
        uint balanceBefore = MockRebaseERC20(asset).balanceOf(address(queue));

        // @info share price increases
        MockRebaseERC20(asset).setSharePrice(1.03e18);

        uint balanceAfter = MockRebaseERC20(asset).balanceOf(address(queue));

        assertGt(balanceAfter, balanceBefore);

        vm.warp(nextReportTs);
        pushReport(deployment.oracle, IOracle.Report({asset: asset, priceD18: 1e18}));

        balanceAfter = MockRebaseERC20(asset).balanceOf(address(queue));
        assertGt(balanceAfter, 0); // @info there is remaining asset here, which is basically rewards
    }

Run the test and it succeeds.

It means that the increased asset (reward part) is still in the queue

Mitigation

Consider either:

  • Explicitly handle stETH by transferring shares
  • Or only support wstETH, which is non-rebase wrapped of stETH

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

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 contracts assume token balances are static and do not account for rebasing, so any increase in balance due to stETH rewards is not tracked or forwarded.

Impact

stETH rewards are unhandled and remain stuck in the contract, and in a negative rebase the queue may be unable to forward the full deposit amount.

What the attacker needed

StETH is used as an asset; a deposit request is pending

The fix

The contracts should either explicitly handle stETH by transferring shares or only support wstETH, the non-rebasing wrapped version of stETH.

How it was found

  1. A depositor sends stETH to the DepositQueue contract as part of a deposit request.
  2. The request waits for the deposit interval and oracle timeout.
  3. During the wait, stETH rewards accrue, increasing the queue's stETH balance.
  4. When the oracle reports a valid price, only the original deposit amount is sent to the vault, leaving the reward portion stuck in the queue.

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.

Some tokens, like stETH, automatically increase or decrease each holder's balance over time to reflect rewards. The queue contracts record a fixed amount when a deposit is requested, but later the actual balance may be higher due to these rewards. The extra tokens are not accounted for and remain stuck in the contract.

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 0rpse

View all

23 more disclosed reports, best first.

More from Mellow Flexible Vaults

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.