Skip to content
Business logic Audit finding Intermediate

Lack of Emergency Market Invalidation Mechanism

The protocol lacks a way for the owner or emergency resolver to mark a market as invalid when no valid outcome can be determined. This causes all locked collateral to remain permanently stuck because users cannot claim winnings without a resolution.

0xeix Follow with PUSH0, al0x23 and 2 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-10-index-fun-order-book-contest-judging/issues/366

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

Found by

0xeix, PUSH0, al0x23, desaperh, typicalHuman

Summary

The Protocol Owner or Emergency Resolver cannot unilaterally invalidate an active market, which will cause a permanent lock of collateral for all market participants if the market outcome is impossible to determine (e.g., source API failure, question ambiguity, or real-world event cancellation).

Root Cause

https://github.com/sherlock-audit/2025-10-index-fun-order-book-contest/blob/main/orderbook-solidity/src/Market/MarketController.sol#L745

The design choice to only allow resolution via MarketResolver.resolveMarketEpoch (or MarketController.emergencyResolveMarket) is a mistake as it does not account for scenarios where a valid outcome or merkle root cannot be determined. In MarketResolver.sol:116, the _resolveMarketEpochInternal function only accepts a merkleRoot as input, requiring a definitive outcome. In MarketController.sol:413, the emergencyResolveMarket function similarly requires a merkleRoot. There is no function to set a state variable that designates a market as "invalid" or "canceled," which would allow users to reclaim their collateral.

Internal Pre-conditions

MarketResolver needs to set oracle and emergencyResolver to be addresses other than address(0).

Market needs to be created by MarketController via Market.createMarket() in Market.sol:98.

Collateral needs to be locked in the Vault via Vault.lockCollateral() from user interactions.

External Pre-conditions

The real-world event associated with the questionId is canceled, or the data source (off-chain service providing the Merkle Root) fails permanently.

Attack Path

A real-world event associated with questionId is canceled, permanently delaying, or deemed unresolvable.

The Oracle cannot provide a valid merkleRoot because no outcome has occurred.

The Emergency Resolver calls MarketController.emergencyResolveMarket() but cannot provide a valid merkleRoot (if they submit a bytes32(0) root, the transaction reverts due to require(merkleRoot != bytes32(0), "Invalid merkle root"); in MarketResolver.sol:123).

Without a valid merkleRoot or an invalidation flag, the Condition ID remains unresolved (isResolved[conditionId] is false).

Market Participants call MarketController.claimWinnings() in MarketController.sol:349.

The transaction reverts due to require(marketResolver.getResolutionStatus(conditionId), "Market not resolved"); in MarketController.sol:357.

Impact

The Market Participants suffer an indefinite, potentially permanent loss of all locked collateral in the Vault for that specific conditionId. This could equate to a 100% loss of all staked funds for that market if the resolution source becomes permanently unavailable.

PoC

Non Applicable ( Lack of mechanism)

Mitigation

Add a bool isInvalidated mapping in MarketResolver.sol and a corresponding invalidateMarket(bytes32 questionId, uint256 epoch) function callable by onlyEmergencyResolver.

Modify the claimWinnings and batchClaimWinnings functions in MarketController.sol to allow users to burn their position tokens (all outcomes) and reclaim 100% of their proportional locked collateral from the Vault if the market is marked as invalidated.

The original report as published on Sherlock, by 0xeix. 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

The design only allows market resolution by providing a valid merkle root, with no mechanism to mark a market as invalid or cancelled.

Impact

All locked collateral for that market could be permanently lost, potentially a 100% loss of staked funds, if the resolution source becomes permanently unavailable.

What the attacker needed

Market created and collateral locked; real-world event cancelled or data source fails; emergency resolver cannot provide merkle root

The fix

Add an invalidation flag and function callable by the emergency resolver, and allow users to burn position tokens and reclaim collateral when a market is invalidated.

How it was found

  1. A real-world event associated with a questionId is cancelled or becomes unresolvable.
  2. The oracle cannot provide a valid merkle root because no outcome occurred.
  3. The emergency resolver calls emergencyResolveMarket but cannot supply a valid merkle root; submitting an empty root reverts.
  4. Without a valid merkle root or invalidation flag, the condition remains unresolved.
  5. Market participants call claimWinnings, but the transaction reverts because the market is not resolved.

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.

In this system, people put money into a market that pays out based on a real-world event. If that event is cancelled or the data source fails, there is no way to say 'this market is void' and give everyone their money back. The money stays locked forever.

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.

More by 0xeix

View all

10 more disclosed reports, best first.

More from Index Fun Order Book

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.