Skip to content
Business logic Audit finding Intermediate

Incorrect `tokensClaimed` calculation in `EthenaCooldownHolder::_finalizeCooldown()` blocks withdrawals

When the sUSDe cooldown duration is zero, the withdrawal manager immediately redeems sUSDe for USDe and holds it in the cooldown holder. Later, the finalisation function calculates the claimed amount as the difference in USDe balance before and after unstaking, which is zero because the USDe was already present, so users cannot claim their withdrawn tokens.

0xDeoGratias Follow with 0xc0ffEE, 0xpiken and 18 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-06-notional-exponent-judging/issues/263

Found by

0xDeoGratias, 0xc0ffEE, 0xpiken, 0xzey, Atharv, Cybrid, KungFuPanda, Ragnarok, Schnilch, X0sauce, almurhasan, boredpukar, bretzel, elolpuer, hgrano, holtzzx, kangaroo, patitonar, pseudoArtist, touristS, xiaoming90

Summary

Users are unable to withdraw tokens from the EthenaWithdrawRequestManager contract when initiating a withdrawal while sUSDe.cooldownDuration() is set to 0, due to flawed logic in the EthenaCooldownHolder::_finalizeCooldown() function.

Root Cause

When a user initiates a withdrawal request via the EthenaWithdrawRequestManager contract, it internally calls EthenaCooldownHolder::_startCooldown():

EthenaCooldownHolder::_startCooldown() function:

Solidity
function _startCooldown(uint256 cooldownBalance) internal override {
      uint24 duration = sUSDe.cooldownDuration();
      if (duration == 0) {
          // If the cooldown duration is set to zero, can redeem immediately
=>        sUSDe.redeem(cooldownBalance, address(this), address(this));
      } else {
         ...
      }
  }

If cooldownDuration is 0, the sUSDe is immediately redeemed for USDe, and the USDe tokens are transferred to the EthenaCooldownHolder contract. Later, when the user finalizes their withdrawal, EthenaCooldownHolder::_finalizeCooldown() is called:

EthenaCooldownHolder::_finalizeCooldown() function:

Solidity
function _finalizeCooldown() internal override returns (uint256 tokensClaimed, bool finalized) {
    uint24 duration = sUSDe.cooldownDuration();
    IsUSDe.UserCooldown memory userCooldown = sUSDe.cooldowns(address(this));

    if (block.timestamp < userCooldown.cooldownEnd && 0 < duration) {
        // Cooldown has not completed, return a false for finalized
        return (0, false);
    }

    uint256 balanceBefore = USDe.balanceOf(address(this));
    if (0 < userCooldown.cooldownEnd) sUSDe.unstake(address(this));
    uint256 balanceAfter = USDe.balanceOf(address(this));

=>  tokensClaimed = balanceAfter - balanceBefore;
    USDe.transfer(manager, tokensClaimed);
    finalized = true;
}

Since the USDe has already been withdrawn to the holder contract at the time the withdrawal request is initiated, balanceBefore is equal to balanceAfter. As a result, tokensClaimed is incorrectly calculated as 0, preventing users from claiming any tokens from their withdrawal request.

Impact

Users are unable to claim any tokens from their withdrawal requests if they were initiated when sUSDe.cooldownDuration() was 0.

Mitigation

Track the balance change when initiating a withdrawal request while sUSDe.cooldownDuration() is set to 0, and use this state to determine the balance change when finalizing the withdrawal request.

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/notional-finance/notional-v4/pull/19

The original report as published on Sherlock, by 0xDeoGratias. 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

The finalisation logic assumes tokens are only received during finalisation, but when cooldown duration is zero, tokens are received earlier, so the balance difference is zero.

Impact

Users are unable to claim any tokens from their withdrawal requests if they were initiated when sUSDe.cooldownDuration() was 0.

What the attacker needed

SUSDe.cooldownDuration() is 0; user initiates withdrawal request

The fix

The protocol team fixed this issue by tracking the balance change when initiating a withdrawal request while cooldown duration is zero and using that state when finalising.

How it was found

  1. Set sUSDe.cooldownDuration() to 0.
  2. User initiates a withdrawal request via EthenaWithdrawRequestManager, which calls _startCooldown and immediately redeems sUSDe for USDe, transferring USDe to the holder.
  3. User later finalises the withdrawal, triggering _finalizeCooldown.
  4. The function calculates tokensClaimed as the difference between USDe balance after and before unstaking, which is zero.
  5. The user receives no tokens.

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 user asks to withdraw their tokens. The system normally waits for a cooldown period, but if the cooldown is set to zero, it immediately converts the tokens and holds them. Later, when the user tries to finalise the withdrawal, the system checks how many new tokens arrived during finalisation, sees none because they were already there, and therefore gives the user nothing.

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

View all

2 more disclosed reports, best first.

More from Notional Exponent

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.