Skip to content
DoS Audit finding Intermediate

`initializeMarket` can be frontran, preventing markets from being configured in `MorphoLendingRouter `

The router's market initialisation can be front-run by anyone calling Morpho's market creation directly with the same parameters, because Morpho only allows a market to be created once. This blocks the router from storing its parameters and makes the affected vault unusable.

0xBoraichoT Follow with 0xPhantom2, 0xRstStn and 11 others

Originally disclosed on Sherlock

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

This issue has been acknowledged by the team but won't be fixed at this time.

Found by

0xBoraichoT, 0xPhantom2, 0xRstStn, 0xodus, 0xpiken, Hueber, Ragnarok, X0sauce, coffiasd, dan__vinci, patitonar, underdog, xiaoming90, y4y

Summary

initializeMarket can be frontran, creating the same morpho market as the expected when initializing.

Root Cause

In MorphoLendingRouter.sol#L51, the router will try to initialize a market for a certain market params configuration. Note that initializeMarket is the only way to store data for the vault in the corresponding s_morphoParams mapping, and it is critical that this mapping is written to, as marketParams() wwill [fetch some of the data from the stored mapping(https://github.com/sherlock-audit/2025-06-notional-exponent/blob/main/notional-v4/src/routers/MorphoLendingRouter.sol#L59), and this function is used across the whole router contract.

The problem is that anybody can frontrun the initialization by directly calling morpho's createMarket() function, creating the same market. After that, the initialization will fail because Morpho ensures that the same market can only be created once. Because of this, markets initializations will be dos'ed, and the router won't be usable for the corresponding vault with the desired market params.

Internal Pre-conditions

None.

External Pre-conditions

None.

Attack Path

  1. upgradeAdmin calls initializeMarket
  2. Malicious user frontruns the call, calling Morpho's createMarket with the same market params as the initialization.
  3. initializeMarket fails due to the check in market creation.

Impact

Medium, it is possible to DoS market initialization, which will prevent storing the corresponding market for the given vault, preventing such vault from being used.

PoC

No response

Mitigation

Consider implementing a try/catch statement. If the market creation fails, it will mean the market was already created, allowing configuration to still be performed

Discussion

jeffywu

While true, we won't fix this. It's highly unlikely to happen in practice. In the 0.000001% chance that someone actually does this, we would have to run an upgrade on the LendingRouter to set the parameters as a one off. This would require a 7 day upgrade window but it is not unrecoverable as suggested.

The more likely scenario is to protect against a finger gun where the function is called twice on accident by someone trying to set up a new vault.

The original report as published on Sherlock, by 0xBoraichoT. 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 router assumes it will be the one to create the Morpho market and does not handle the case where the market already exists.

Impact

It is possible to deny market initialisation, preventing the vault's market from being stored and the vault from being used; the team notes recovery would need a seven-day router upgrade.

What the attacker needed

Attacker can front-run the admin transaction

The fix

The team acknowledged the issue but chose not to fix it, suggesting a try/catch so configuration can continue if the market already exists.

How it was found

  1. The upgrade admin calls initializeMarket on the router.
  2. A malicious user front-runs it by calling Morpho's createMarket with the same parameters.
  3. The router's initializeMarket fails because the market already exists.

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 router sets up a lending market and saves its settings in its own storage. Anyone can create that same market first on the underlying platform, and the platform refuses to create a market twice. The router's setup then fails, so that vault cannot be used until the team intervenes.

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.

More by 0xBoraichoT

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.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.