Wrong price validation in oracle causes early DoS and allows late-stage price manipulation
The oracle's sanity check computes an annualised percentage yield by dividing by the time elapsed since the protocol started, which magnifies small normal price deviations early on and lets large deviations pass later. This can cause the Morpho market to revert on health checks early and allow abnormal prices to be accepted later.
0x73696d616f Follow with 0xAsen, 0xMosh and 39 others
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-11-stnxm-by-easedefi-judging/issues/708
Found by
0x73696d616f, 0xAsen, 0xMosh, 0xSecurious, 0xc0ffEE, 0xeix, 0xgh0stcybers3c, ChargingFoxSec, HeckerTrieuTien, JuggerNaut, ReidnerM, Sa1ntRobi, Sir_Shades, Solea, SuperDevFavour, TianZun, Vesko210, Wojack, X0sauce, ZeronautX, aster, befree3x, boredpukar, destiny_rs, djshaneden, ethaga, h2134, iamephraim, joicygiore, khaye26, kimnoic, maxim371, merlin, ni8mare, pecata17107, securewei, shieldrey, slavina, th3hybrid, touristS, typicalHuman, werulez99
Summary
Sanity check's reliance on elapsedTime will reject normal price shift in early stages of the protocol and allow price manipulation later on
Root Cause
In oracle contract implementation dedicated for Morpho market, sanePrice function validates price of stNXM in wNXM terms in the following way:
function sanePrice(uint256 _price) public view returns (bool) {
// Amount of 1 year it's been
@> uint256 elapsedTime = block.timestamp - startTime;
// If price is lower than equal it's not too high.
if (_price < 1e18) return true;
@> uint256 apy = (_price - 1e18) * 31_536_000 / elapsedTime;
return apy <= saneApy;
}
Such APY formula will magnify small normal shifts in TWAP price in early stages of the protocol, when elapsedTime is small. Consider the following situation:
elapsedTimeis equal to 7 days- For this period of time, price was higher at around 1% deviation mark -
1.01e18, which is normal price shifts and is definitely not price manipulation - The resulting APY at 7 day mark (highest denominator) - around
5.2e17, which will cause a revert on this line. Quoting an oracle with such price deviation on DEX would revert as well, since denominator is smaller
For big elapsedTime values, big price deviations will be rendered as valid:
elapsedTimeis equal to 3 years- Price at the moment of quoting is
2.5e18-1.5e18more than target1e18price - Resulting APY is at borderline -
5e17, which allows such price to pass
First scenario will break the Morpho market usage, since any operation that would trigger _isHealthy check would revert due to price being rejected in oracle
Internal Pre-conditions
None
External Pre-conditions
None
Attack Path
There is no real attack path, since normal operations will cause Morpho disturbance
Impact
For intial stages, when elapsedTime is small - Morpho usage is easily disturbed by normal price movements
For later stages, when elapsedTime is big - abnormal prices that may happen during low liquidity periods can pass
PoC
No response
Mitigation
No response
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/EaseDeFi/stNXM-Contracts/commit/7a9abd4e78bfb29416e9677040aa3650999ee353
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 sanity check annualises the price deviation by dividing by the total elapsed time since protocol start instead of using a fixed window or a more robust measure, making the threshold time-dependent.
Impact
Early on, normal price movements can cause the oracle to reject prices and break Morpho market operations; later, abnormal prices during low liquidity may be accepted.
What the attacker needed
None
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.
An oracle is a service that feeds prices into a smart contract. This oracle checks that a new price is not too far from the expected value by converting the difference into a yearly percentage. Because it divides by the time since the protocol started, the same small price change looks huge at the beginning and a large change looks small after a few years.
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.