OracleUtils.ethLeftSide() is not correct for some tokens, leading to incorrect nuAsset pricing
The helper that decides whether ETH sits on the left or right of a Chainlink price feed only looks at the first three characters of the feed description, so a feed named for a liquid staking token starting with 'ETH' is misread as ETH being the numerator. This causes the protocol to price such assets incorrectly.
Source: https://github.com/sherlock-audit/2024-12-numa-audit-judging/issues/38
Found by
juaan
Summary
OracleUtils::ethLeftSide() is used to check whether ETH is in the numerator or the denominator of the price feed, in order to correctly price the paired asset.
The check is implemented incorrectly, causing incorrect pricing of assets in some cases.
Root Cause
The function OracleUtils::ethLeftSide() checks the first 3 characters of the pricefeed’s description string, and checks if they are “ETH”. If so, it assumes that the numerator is ETH.
The issue is that there are assets which have “ETH” as the first 3 characters, but are not ETH. An example is the LST, Stader ETHx.
It has a price feed on Arbitrum Mainnet, denominated in ETH, with the description string “ETHx/ETH”.
Even though ETH is on the right side, the ethLeftSide() function will return true, which is incorrect.
This causes the asset to be priced incorrectly in the NumaPrinter, since it assumes that the asset is ETH.
Note: the protocol team has stated:
This should be able to theoretically mint any asset with a chainlink (18 decimals), including RWA assets.
This could be assets like currencies (nuUSD, nuEUR, etc), commodities (nuGOLD, nuOIL, etc), other cryptocurrencies (nuETH, nuBTC), and stocks (nuTSLA, nuNVDA, etc)
Internal pre-conditions
An asset like ETHx is used as a nuAsset
External pre-conditions
No response
Attack Path
No response
Impact
nuAssets can be priced incorrectly in some cases
PoC
No response
Mitigation
Check the first 4 bytes of the pricefeed's description string, and return true only if the first 4 bytes are the same as “ETH/” This ensures that the function is always correct
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 function infers the position of ETH from a three-character prefix of the feed description rather than matching the full token symbol, so symbols like 'ETHx' are misclassified.
Impact
Assets whose feed description begins with 'ETH' but which are not ETH can be priced incorrectly by the protocol.
What the attacker needed
A nuAsset whose feed name starts with ETH
The fix
The check should compare the first four characters against 'ETH/' so only genuine ETH-denominated feeds are treated as having ETH on the left.
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 feed tells a contract the exchange rate between two things, and the contract needs to know which one is on top of the fraction. This code guesses by looking at the first three letters of the feed's name, so a token whose name begins with 'ETH' is mistaken for real ETH. The result is that the contract does the maths the wrong way round and values the asset wrongly.