Revert in `getWithdrawRequestValue()` function will brick the account
The getWithdrawRequestValue() function reverts if any token has no withdraw request, which can happen when a token's exit balance rounds down to zero. This causes the price() function to revert, preventing Morpho from fetching the price and leaving the account's position stuck, unable to exit, repay, withdraw, or be liquidated.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-06-notional-exponent-judging/issues/779
Found by
xiaoming90
Summary
Root Cause
- Revert can occur in
getWithdrawRequestValue()function, which the criticalprice()function depends on, due to a lack of proper error handling. - Incorrect assumption that the exit balance will never be zero under any circumstances.
Internal Pre-conditions
External Pre-conditions
Attack Path
Main Issue
It was found that when computing the value of the withdraw request, it will attempt to loop through all Cruve's pool tokens and check if there is a withdraw request for the current token. If not, the transaction will revert in Line 332 below.
The issue is that if it is ever possible to cause a revert in Line 332, it will be a serious issue because Morpho can no longer fetch the price. The Notional's price() relies on the getWithdrawRequestValue() function. If the price() reverts when Morpho is reading it, the affected account's position will be stuck forever, as none of the operations (exit position, repay debt, withdraw collateral, liquidation) can be performed.
File: AbstractSingleSidedLP.sol
319: function getWithdrawRequestValue(
320: address account,
321: address asset,
322: uint256 shares
323: ) external view returns (uint256 totalValue) {
324: ERC20[] memory tokens = TOKENS();
325:
326: for (uint256 i; i < tokens.length; i++) {
327: IWithdrawRequestManager manager = ADDRESS_REGISTRY.getWithdrawRequestManager(address(tokens[i]));
328: // This is called as a view function, not a delegate call so use the msg.sender to get
329: // the correct vault address
330: (bool hasRequest, uint256 value) = manager.getWithdrawRequestValue(msg.sender, account, asset, shares);
331: // Ensure that this is true so that we do not lose any value.
332: require(hasRequest);
333: totalValue += value;
334: }
335: }
Let's review if there is a possibility where the revert in Line 332 can be triggered.
It was found that it is possible under certain conditions. If the exit balance of one of the tokens is zero, no withdraw request will be created for that specific token, as shown in Line 362. Creation of the withdraw request will be skipped.
File: AbstractSingleSidedLP.sol
353: function initiateWithdraw(
354: address account,
355: uint256 sharesHeld,
356: uint256[] calldata exitBalances,
357: bytes[] calldata withdrawData
358: ) external override returns (uint256[] memory requestIds) {
359: ERC20[] memory tokens = TOKENS();
360:
361: requestIds = new uint256[](exitBalances.length);
362: for (uint256 i; i < exitBalances.length; i++) {
363: if (exitBalances[i] == 0) continue;
364: IWithdrawRequestManager manager = ADDRESS_REGISTRY.getWithdrawRequestManager(address(tokens[i]));
365:
366: tokens[i].checkApprove(address(manager), exitBalances[i]);
367: // Will revert if there is already a pending withdraw
368: requestIds[i] = manager.initiateWithdraw({
369: account: account,
370: yieldTokenAmount: exitBalances[i],
371: sharesAmount: sharesHeld,
372: data: withdrawData[i]
373: });
374: }
375: }
Thus, the current implementation will only work if there is an assumption or invariant that the exit balance of any tokens can never be zero under any circumstances.
However, this assumption and the invariant do not hold at all times due to the following reasons:
- If users have almost entirely swapped out one token, leaving its balance nearly or exactly zero, then proportional withdrawal will result in zero for that token. If it is near zero or an extremely small amount, the returned token amount might round down to zero.
- Notional does not enforce a minimum position size. Thus, if the position is tiny, the LP token to be exited will be tiny, and withdrawal for a given token can round down to zero. Tokens with small decimal precision (e.g, USDC=6, WBTC=8) are more susceptible to this rounding problem.
- After a major “depeg event” or manipulation, one token could be totally depleted
Impact
Funds are being stuck as shown in the scenario above.
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/23/commits/a809036c2543ba434309374de715a8173b7bf39a
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 require(hasRequest) check in getWithdrawRequestValue() does not handle the case where a token's exit balance is zero, which causes initiateWithdraw() to skip creating a request for that token.
Impact
The account's position becomes permanently stuck, as no operations (exit, repay, withdraw, liquidation) can be performed, potentially leading to loss of funds.
What the attacker needed
A token's exit balance rounds down to zero; position is small or token has low decimals
The fix
The protocol team fixed this issue in a pull request.
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 smart contract function that calculates the value of a withdrawal request assumes every token will have a withdrawal request. If one token's balance is zero, the function crashes (reverts). Because another system relies on this function to get a price, the whole account gets frozen: the user cannot withdraw funds or repay debt, and even liquidation fails.
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.