Skip to content
Business logic Audit finding Advanced

Setup with `asset = WETH` and a Curve pool that contains Native ETH will lead to a loss for the users

When a vault's asset is WETH and the Curve pool holds native ETH, the code treats native ETH as a token address of zero, so proportional exits try to sell native ETH the vault no longer holds, causing a revert. This blocks withdrawal requests and forces single-sided exits that can incur losses due to pool imbalance.

xiaoming90 Follow

Originally disclosed on Sherlock

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

Found by

xiaoming90

Summary

Root Cause

Internal Pre-conditions

External Pre-conditions

Attack Path

Assume a Yield Strategy vault where its asset is WETH and the Curve Pool is Native ETH/wstETH. In this case, calling the TOKENS() function will return:

  • tokens[0] = Curve's 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE = Converted to 0x0000 (Native ETH) during initialization
  • tokens[1] = 0xB82381A3fBD3FaFA77B3a7bE693342618240067b (wstETH)

https://github.com/sherlock-audit/2025-06-notional-exponent/blob/main/notional-v4/src/single-sided-lp/CurveConvex2Token.sol#L162

Solidity
File: CurveConvex2Token.sol
162:     function TOKENS() internal view override returns (ERC20[] memory) {
163:         ERC20[] memory tokens = new ERC20[](_NUM_TOKENS);
164:         tokens[0] = ERC20(TOKEN_1);
165:         tokens[1] = ERC20(TOKEN_2);
166:         return tokens;
167:     }

The _PRIMARY_INDEX will be set to 0, which is the first token of the Curve pool. The condition at Line 59 will evaluate to True.

https://github.com/sherlock-audit/2025-06-notional-exponent/blob/main/notional-v4/src/single-sided-lp/CurveConvex2Token.sol#L59

Solidity
File: CurveConvex2Token.sol
57:         // Assets may be WETH, so we need to unwrap it in this case.
58:         _PRIMARY_INDEX =
59:             (TOKEN_1 == _asset || (TOKEN_1 == ETH_ADDRESS && _asset == address(WETH))) ? 0 :
60:             (TOKEN_2 == _asset || (TOKEN_2 == ETH_ADDRESS && _asset == address(WETH))) ? 1 :
61:             // Otherwise the primary index is not set and we will not be able to enter or exit
62:             // single sided.
63:             type(uint8).max;

During the exiting the position, liquidation, or initiating withdrawal, the LP tokens will be unstaked/redeemed from Curve or Convex. Let's review these three (3) operations.

Initiating withdrawal

Initiating withdrawal will eventually call the unstakeAndExitPool function below. After calling the _unstakeLpTokens() and _exitPool() functions in Lines 201 and 203 below, the vault will receive back 100 Native ETH and 100 wstETH (as an example).

[!NOTE]

Note that when initiating a withdrawal, it will always exit proportionally, and not single-sided as per here. Users do not have the option to choose whether they want to exit proportionally or single-sidedly during the initiation of a withdrawal.

Subsequently, the 100 Native ETH will be wrapped to 100 WETH in Line 207 below with the WETH.deposit() function. So, there is zero Native ETH left in the vault. At this point, the balance of the vault is: 100 WETH + 100 wstETH.

https://github.com/sherlock-audit/2025-06-notional-exponent/blob/main/notional-v4/src/single-sided-lp/CurveConvex2Token.sol#L207

Solidity
File: CurveConvex2Token.sol
198:     function unstakeAndExitPool(
199:         uint256 poolClaim, uint256[] memory _minAmounts, bool isSingleSided
200:     ) external returns (uint256[] memory exitBalances) {
201:         _unstakeLpTokens(poolClaim);
202: 
203:         exitBalances = _exitPool(poolClaim, _minAmounts, isSingleSided);
204: 
205:         if (ASSET == address(WETH)) {
206:             if (TOKEN_1 == ETH_ADDRESS) {
207:                 WETH.deposit{value: exitBalances[0]}();
208:             } else if (TOKEN_2 == ETH_ADDRESS) {
209:                 WETH.deposit{value: exitBalances[1]}();
210:             }
211:         }
212:     }

Since two tokens (Native ETH and wstETH) are being returned, this is not a single-sided exit. Thus, the _executeRedemptionTrades function in Line 176 will be executed.

https://github.com/sherlock-audit/2025-06-notional-exponent/blob/main/notional-v4/src/single-sided-lp/AbstractSingleSidedLP.sol#L176

Solidity
File: AbstractSingleSidedLP.sol
145:     function _redeemShares(
146:         uint256 sharesToRedeem,
147:         address sharesOwner,
148:         bool isEscrowed, // @audit-info True if there is pending withdraw request
149:         bytes memory redeemData
150:     ) internal override {
151:         RedeemParams memory params = abi.decode(redeemData, (RedeemParams));
152: 
153:         // Stores the amount of each token that has been withdrawn from the pool.
154:         uint256[] memory exitBalances;
155:         bool isSingleSided;
156:         ERC20[] memory tokens;
157:         if (isEscrowed) {
158:             // Attempt to withdraw all pending requests, tokens may be different if there
159:             // is a withdraw request.
160:             (exitBalances, tokens) = _withdrawPendingRequests(sharesOwner, sharesToRedeem);
161:             // If there are pending requests, then we are not single sided by definition
162:             isSingleSided = false;
163:         } else {
164:             isSingleSided = params.redemptionTrades.length == 0;
165:             uint256 yieldTokensBurned = convertSharesToYieldToken(sharesToRedeem);
166:             exitBalances = _unstakeAndExitPool(yieldTokensBurned, params.minAmounts, isSingleSided);
167:             tokens = TOKENS();
168:         }
169: 
170:         if (!isSingleSided) {
171:             // If not a single sided trade, will execute trades back to the primary token on
172:             // external exchanges. This method will execute EXACT_IN trades to ensure that
173:             // all of the balance in the other tokens is sold for primary.
174:             // Redemption trades are not automatically enabled on vaults since the trading module
175:             // requires explicit permission for every token that can be sold by an address.
176:             _executeRedemptionTrades(tokens, exitBalances, params.redemptionTrades);
177:         }
178:     }

Recall that:

  • tokens[0] = 0x0000 (Native ETH)
  • tokens[1] = 0xB82381A3fBD3FaFA77B3a7bE693342618240067b (wstETH)

Note that the condition in Line 229 of the _executeRedemptionTrades() function below will never be True because:

Solidity
if (address(tokens[i]) == address(asset))
if (address(0x0) == WETH)
if (false)

In the first iteration of the for-loop, the Trade.sellToken will be set to 0x0000 (Native ETH), which means it will attempt to sell 100 Native ETH. However, the issue here is that when it attempts to sell 100 Native ETH, the trade module will revert due to insufficient balance because the vault does not have 100 Native ETH.

https://github.com/sherlock-audit/2025-06-notional-exponent/blob/main/notional-v4/src/single-sided-lp/AbstractSingleSidedLP.sol#L223

Solidity
File: AbstractSingleSidedLP.sol
223:     function _executeRedemptionTrades(
224:         ERC20[] memory tokens,
225:         uint256[] memory exitBalances,
226:         TradeParams[] memory redemptionTrades
227:     ) internal returns (uint256 finalPrimaryBalance) {
228:         for (uint256 i; i < exitBalances.length; i++) {
229:             if (address(tokens[i]) == address(asset)) {
230:                 finalPrimaryBalance += exitBalances[i];
231:                 continue;
232:             }
233: 
234:             TradeParams memory t = redemptionTrades[i];
235:             // Always sell the entire exit balance to the primary token
236:             if (exitBalances[i] > 0) {
237:                 Trade memory trade = Trade({
238:                     tradeType: t.tradeType,
239:                     sellToken: address(tokens[i]),
240:                     buyToken: address(asset),
241:                     amount: exitBalances[i],
242:                     limit: t.minPurchaseAmount,
243:                     deadline: block.timestamp,
244:                     exchangeData: t.exchangeData
245:                 });
246:                 (/* */, uint256 amountBought) = _executeTrade(trade, t.dexId);
247: 
248:                 finalPrimaryBalance += amountBought;
249:             }
250:         }
251:     }

Due to the revert, this means that in this setup, none of the users can initiate a withdrawal request because initiating a withdrawal request will always exit proportionally. As shown above, it will ultimately result in a revert.

Exiting position and liquidation

How about exiting position and liquidation? Are these two critical operations affected by this revert? If these operations are performed via proportional exit, it will eventually revert the transaction too. However, these operations give callers the option to choose if they want to exit proportional or single-sided.

Let's see if we can workaround this problem by performing a single-side exit by setting params.redemptionTrades.length == 0 since we already know that proportional exit does not work, as discussed earlier.

When the _exitPool() function below is executed, the exit balances will be as follows (assume 1 wstETH = 1 ETH):

  • exitBalances[PRIMARY_INDEX] = exitBalances[0] = 200 Native ETH
  • exitBalances[1] = 0

200 Native ETH were later swapped for 200 WETH. It works as intended as all LP tokens have been redeemed back to the asset token (200 WETH)

https://github.com/sherlock-audit/2025-06-notional-exponent/blob/main/notional-v4/src/single-sided-lp/CurveConvex2Token.sol#L244

Solidity
File: CurveConvex2Token.sol
244:     function _exitPool(
245:         uint256 poolClaim, uint256[] memory _minAmounts, bool isSingleSided
246:     ) internal returns (uint256[] memory exitBalances) {
247:         if (isSingleSided) {
248:             exitBalances = new uint256[](_NUM_TOKENS);
249:             if (CURVE_INTERFACE == CurveInterface.V1 || CURVE_INTERFACE == CurveInterface.StableSwapNG) {
250:                 // Method signature is the same for v1 and stable swap ng
251:                 exitBalances[_PRIMARY_INDEX] = ICurve2TokenPoolV1(CURVE_POOL).remove_liquidity_one_coin(
252:                     poolClaim, int8(_PRIMARY_INDEX), _minAmounts[_PRIMARY_INDEX]
253:                 );
254:             } else {
255:                 exitBalances[_PRIMARY_INDEX] = ICurve2TokenPoolV2(CURVE_POOL).remove_liquidity_one_coin(
256:                     // Last two parameters are useEth = true and receiver = this contract
257:                     poolClaim, _PRIMARY_INDEX, _minAmounts[_PRIMARY_INDEX], true, address(this)
258:                 );
259:             }
260:         } else {

In summary, during exiting position and liquidation, the user is always forced to perform a single-sided exit via Curve's remove_liquidity_one_coin. Forcing users to perform a single-sided exit is an issue here.

However, the problem here is that due to the AMM and fee math in the Curve pool, any single-asset withdrawals that worsen the pool imbalance will incur a greater imbalance penalty. Thus, if the Curve pool is imbalanced, the single-sided exit will result in fewer assets being received.

Impact

Exiting position and liquidation

High, as this led to a loss of assets during the forced single-sided exit.

The impact is similar to the past Notional contest issues (https://github.com/sherlock-audit/2023-10-notional-judging/issues/87 and https://github.com/sherlock-audit/2023-10-notional-judging/issues/82), which are judged as a valid High.

Initiating withdrawal request

Users are unable to initiate a withdrawal request due to a revert. In this case, users are always forced to swap their yield tokens for asset tokens via a DEX, which incurs unnecessary slippage and fees.

PoC

No response

Mitigation

No response

Discussion

sherlock-admin2

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

The original report as published on Sherlock, by xiaoming90. 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 code maps Curve's native ETH sentinel address to address(0) but then compares token addresses against the vault's WETH asset, so native ETH is never recognised as the primary asset and is incorrectly treated as a token to sell.

Impact

Users cannot initiate withdrawal requests because the transaction reverts, and during exit or liquidation they are forced into a single-sided exit that may return fewer assets if the pool is imbalanced.

What the attacker needed

Vault asset is WETH; Curve pool contains native ETH; user initiates withdrawal or exit

The fix

The protocol team fixed this issue in a pull request.

How it was found

  1. Set up a vault whose asset is WETH and whose Curve pool contains native ETH and wstETH.
  2. Initiate a withdrawal, which always exits the pool proportionally.
  3. The vault receives native ETH and wstETH, then wraps the native ETH into WETH.
  4. The redemption trade logic tries to sell the native ETH balance, which is now zero, and reverts.

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 vault holds two tokens in a Curve pool: native ETH and wstETH. The vault's own asset is WETH, which is a wrapped version of ETH. The code confuses native ETH with a zero address, so when it tries to sell the ETH it thinks it has, the sale fails because the ETH was already converted to WETH. This means users cannot start a normal withdrawal and are forced into a less favourable single-token exit.

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 xiaoming90

View all

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