When users borrow directly from Morpho price of the collateral will not be accurate
When a user has a withdrawal request and borrows directly from Morpho (bypassing the lending router), the Morpho price oracle prices the user's shares based on yield token holdings rather than the withdrawal request value. This causes the oracle to misprice the user's collateral.
mstpr-brainbot Follow with rudhra1749
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-06-notional-exponent-judging/issues/450
Found by
mstpr-brainbot, rudhra1749
Summary
When users have a withdrawal request, the Morpho price oracle will price the request based on the requested value instead of the share amount. However, if users choose to borrow directly from Morpho bypassing the lending router the shares will be priced based on their raw share value, not the request value.
Root Cause
As seen in the following lines:
If the transient t_currentAccount variable is set and the user has a withdrawal request, then the price will be based on the withdrawal request value. However, if the user is borrowing directly not via the lending router the t_currentAccount is never set. This causes the call to fall back to super.convertToAssets(shares), which prices based on yield token holdings instead.
This introduces a discrepancy: a user with an active withdrawal request is not holding yield tokens, but their shares will still be priced as if they are—potentially leading to mispricing or incorrect collateral valuation.
Internal Pre-conditions
- Request a withdrawal and borrow from MORPHO directly not via lending router
External Pre-conditions
None needed
Attack Path
Happens naturally
Impact
Oracle will misprice the users collateral. Users shares are not corresponding to yield tokens but withdrawal request underlying tokens but the oracle will price them wrong!
PoC
// forge test --match-test test_price_Inconsistency -vv
function test_price_Inconsistency() public {
console.log("Asset is", IERC20Metadata(address(asset)).symbol());
address tapir = msg.sender;
// deal(address(asset), msg.sender, defaultDeposit);
_enterPosition(tapir, defaultDeposit, 0);
uint256 balanceBefore = lendingRouter.balanceOfCollateral(tapir, address(y));
vm.startPrank(tapir);
lendingRouter.initiateWithdraw(tapir, address(y), getWithdrawRequestData(tapir, balanceBefore));
MarketParams memory marketParams = MorphoLendingRouter(address(lendingRouter)).marketParams(address(y));
Id idx = Id.wrap(keccak256(abi.encode(marketParams)));
address oracle = marketParams.oracle;
console.log("Price of the asset is", IOracle(oracle).price());
console.log("Price of the vault is", y.price(tapir));
}
Test Logs: Ran 1 test for tests/TestSingleSidedLPStrategyImpl.sol:Test_LP_Curve_pxETH_ETH [PASS] test_price_Inconsistency() (gas: 1904287) Logs: Asset is WETH Price of the asset is 1001461263579509710000000000000 Price of the vault is 1001459261273599425000000000000
Mitigation
tbd
Discussion
jeffywu
The fix removes the ability to borrow from Morpho directly: https://github.com/notional-finance/notional-v4/pull/10/files#diff-2ac57114dd95cd7f2ec36fb64d9895e7ac22e0f702c03de327ed3cead58642f8R130
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/notional-finance/notional-v4/pull/10/files#diff-2ac57114dd95cd7f2ec36fb64d9895e7ac22e0f702c03de327ed3cead58642f8R130
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 oracle relies on a transient variable set only by the lending router; direct borrowing bypasses that setup, so the oracle falls back to pricing shares as yield tokens instead of withdrawal request value.
Impact
The oracle will misprice the user's collateral, potentially leading to incorrect collateral valuation.
What the attacker needed
A withdrawal request; borrow directly from Morpho
The fix
The fix removes the ability to borrow from Morpho directly.
How it was found
- Request a withdrawal.
- Borrow from Morpho directly, not via the lending router.
- Observe the oracle price differs from the vault price.
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 price oracle tells a lending system how much a user's collateral is worth. Here, if a user asks to withdraw and then borrows directly from Morpho without going through the usual router, the oracle uses the wrong value for their shares, so the system thinks their collateral is worth a different amount than it really is.