You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sqrtPriceX96 is pulled from Uniswap.slot0, which is the most recent data point and can be manipulated easily via MEV bots and Flashloans with sandwich attacks, which can cause the loss of funds as it is used in the protocol to evaluate getV3SqrtLowestPrice() and getV3SqrtHighestPrice
Root Cause
File: NumaOracle.sol
164: function getV3SpotPrice(
165: address_numaPool,
166: uint_numaAmount167: ) externalviewreturns (uint256) {
168: @> (uint160sqrtPriceX96, , , , , , ) =IUniswapV3Pool(_numaPool).slot0();
257: function getV3SqrtLowestPrice(
258: address_uniswapV3Pool,
259: uint32_intervalShort,
260: uint32_intervalLong261: ) publicviewreturns (uint160) {
262: require(
263: _intervalLong > _intervalShort,
264: "intervalLong must be longer than intervalShort"265: );
266:
267: uint160 sqrtPriceX96;
268:
269: //Spot price of the token270: @> (uint160sqrtPriceX96Spot, , , , , , ) =IUniswapV3Pool(_uniswapV3Pool)
271: .slot0();
329: function getV3SqrtHighestPrice(
330: address_uniswapV3Pool,
331: uint32_intervalShort,
332: uint32_intervalLong333: ) publicviewreturns (uint160) {
334: require(
335: _intervalLong > _intervalShort,
336: "intervalLong must be longer than intervalShort"337: );
338:
339: uint160 sqrtPriceX96;
340: //Spot price of the token341: @> (uint160sqrtPriceX96Spot, , , , , , ) =IUniswapV3Pool(_uniswapV3Pool)
342: .slot0();
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
Price evaluation when EH<->NUMA convertions can be manipulated
PoC
No response
Mitigation
Consider using TWAP pricing instead of slot0
The text was updated successfully, but these errors were encountered:
Ambitious Cedar Monkey
High
ETH
<=>NUMA
conversion is subject to price manipulationSummary
Per the audit README, the protocol will be deployed on ETH (hence it is safe to assume frontrunning by MEV bots is possible)
https://github.com/sherlock-audit/2024-12-numa-audit/blob/main/Numa/contracts/NumaProtocol/NumaOracle.sol#L270
https://github.com/sherlock-audit/2024-12-numa-audit/blob/main/Numa/contracts/NumaProtocol/NumaOracle.sol#L168
https://github.com/sherlock-audit/2024-12-numa-audit/blob/main/Numa/contracts/NumaProtocol/NumaOracle.sol#L341-L342
The
sqrtPriceX96
is pulled fromUniswap.slot0
, which is the most recent data point and can be manipulated easily via MEV bots and Flashloans with sandwich attacks, which can cause the loss of funds as it is used in the protocol to evaluategetV3SqrtLowestPrice()
andgetV3SqrtHighestPrice
Root Cause
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
Price evaluation when EH<->NUMA convertions can be manipulated
PoC
No response
Mitigation
Consider using TWAP pricing instead of
slot0
The text was updated successfully, but these errors were encountered: