Incorrect asset matching for ETH/WETH leads to potential DoS of exitPosition in CurveConvexStrategy
The CurveConvexStrategy contract incorrectly compares token addresses when redeeming shares, failing to skip the swap for the primary token when the strategy's asset is WETH and the pool token is ETH. This causes an unnecessary swap attempt with invalid parameters, potentially reverting and blocking all redemptions, locking user funds.
0xDeoGratias Follow with Cybrid, HeckerTrieuTien and 3 others
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-06-notional-exponent-judging/issues/581
Found by
0xDeoGratias, Cybrid, HeckerTrieuTien, auditgpt, bretzel, touristS
Summary
When redeeming shares in CurveConvexStrategy, the _executeRedemptionTrades function is intended to skip swap logic for the primary token.
However, when the strategy's asset is WETH and one of the exit tokens is ETH_ADDRESS, the comparison (address(tokens[i]) == address(asset)) fails because ETH and WETH have different addresses. This leads to an unnecessary swap attempt using invalid trade parameters, potentially causing a denial of service (DoS).
Root Cause
In the CurveConvex strategy, when redeeming shares (via exitPosition or initiateWithdraw), LP tokens are first unstaked and exited from the pool using unstakeAndExitPool().
If one of the pool tokens is native ETH and the strategy’s ASSET is WETH, the strategy wraps ETH into WETH.
https://github.com/sherlock-audit/2025-06-notional-exponent-sylvarithos/blob/82c87105f6b32bb362d7523356f235b5b07509f9/notional-v4/src/single-sided-lp/CurveConvex2Token.sol#L205
function unstakeAndExitPool(
uint256 poolClaim, uint256[] memory _minAmounts, bool isSingleSided
) external returns (uint256[] memory exitBalances) {
_unstakeLpTokens(poolClaim);
exitBalances = _exitPool(poolClaim, _minAmounts, isSingleSided);
205 if (ASSET == address(WETH)) {
if (TOKEN_1 == ETH_ADDRESS) {
WETH.deposit{value: exitBalances[0]}();
} else if (TOKEN_2 == ETH_ADDRESS) {
WETH.deposit{value: exitBalances[1]}();
}
}
}
When not singlesided trade, it executes trade to convert to primary token. https://github.com/sherlock-audit/2025-06-notional-exponent-sylvarithos/blob/82c87105f6b32bb362d7523356f235b5b07509f9/notional-v4/src/single-sided-lp/AbstractSingleSidedLP.sol#L176
function _redeemShares(
uint256 sharesToRedeem,
address sharesOwner,
bool isEscrowed,
bytes memory redeemData
) internal override {
RedeemParams memory params = abi.decode(redeemData, (RedeemParams));
...
if (!isSingleSided) {
// If not a single sided trade, will execute trades back to the primary token on
// external exchanges. This method will execute EXACT_IN trades to ensure that
// all of the balance in the other tokens is sold for primary.
// Redemption trades are not automatically enabled on vaults since the trading module
// requires explicit permission for every token that can be sold by an address.
_executeRedemptionTrades(tokens, exitBalances, params.redemptionTrades);
}
}
However, in _executeRedemptionTrades(), when iterating over the tokens array to check if a token matches asset (to skip trading), it uses a strict equality check:
https://github.com/sherlock-audit/2025-06-notional-exponent-sylvarithos/blob/82c87105f6b32bb362d7523356f235b5b07509f9/notional-v4/src/single-sided-lp/AbstractSingleSidedLP.sol#L229
function _executeRedemptionTrades(
ERC20[] memory tokens,
uint256[] memory exitBalances,
TradeParams[] memory redemptionTrades
) internal returns (uint256 finalPrimaryBalance) {
for (uint256 i; i < exitBalances.length; i++) {
229 if (address(tokens[i]) == address(asset)) {
finalPrimaryBalance += exitBalances[i];
continue;
}
TradeParams memory t = redemptionTrades[i];
// Always sell the entire exit balance to the primary token
if (exitBalances[i] > 0) {
Trade memory trade = Trade({
tradeType: t.tradeType,
sellToken: address(tokens[i]),
buyToken: address(asset),
amount: exitBalances[i],
limit: t.minPurchaseAmount,
deadline: block.timestamp,
exchangeData: t.exchangeData
});
(/* */, uint256 amountBought) = _executeTrade(trade, t.dexId);
finalPrimaryBalance += amountBought;
}
}
}
This fails when tokens[i] is ETH (i.e., ETH_ADDRESS) and asset is WETH, even though ETH was already converted into WETH during the exit step.
This leads to an unnecessary swap attempt using invalid trade parameters, potentially causing a denial of service (DoS).
Internal Pre-conditions
- The strategy asset is set to WETH.
- The LP token pool contains ETH as one of its underlying tokens.
Impact
A revert in _executeTrade() halts redemptions, locking user funds in the vault. This can block all users from exiting if their share includes ETH from the pool.
Mitigation
Should compare with primary_index.
function _executeRedemptionTrades(
ERC20[] memory tokens,
uint256[] memory exitBalances,
TradeParams[] memory redemptionTrades
) internal returns (uint256 finalPrimaryBalance) {
for (uint256 i; i < exitBalances.length; i++) {
- if (address(tokens[i]) == address(asset)) {
+ if (address(tokens[i]) == PRIMARY_INDEX()) {
finalPrimaryBalance += exitBalances[i];
continue;
}
...
}
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/notional-finance/notional-v4/pull/26/files
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 code uses a strict address equality check between the pool token and the strategy asset, which fails when one is ETH and the other is WETH, even though ETH is wrapped into WETH earlier.
Impact
A revert in the trade execution halts redemptions, locking user funds in the vault and potentially blocking all users from exiting.
What the attacker needed
Strategy asset is WETH; LP pool contains ETH as underlying token
The fix
The issue was fixed by comparing the token address with the primary index instead of the asset address.
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.
When users withdraw their funds from a vault, the contract is supposed to skip swapping the main token (like WETH) because it's already what they want. But if the pool uses ETH instead of WETH, the contract doesn't recognise them as the same and tries to swap anyway, which fails and stops everyone from withdrawing.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.