UMA Dispute Router Legacy Oracle Fallback Diff Security Audit
OpenZeppelin Security
Findings
Total issues: 7 (6 resolved)
Critical: 0 (0 resolved) · High: 0 (0 resolved) · Medium: 1 (0 resolved) · Low: 2 (2 resolved)
Notes & Additional Information
4 notes raised (4 resolved)
Client Reported Issues
0 reported issues (0 resolved)
Scope
OpenZeppelin conducted a diff audit of two pull requests in the UMAprotocol/protocol-private repository: pull request #18 at commit 05b70e3, which adds a legacy oracle fallback, and pull request #22 at commit 8e5718b, which adds a per-block forwarding budget. Both pull requests are based on commit 0a13c33 and were reviewed together, as combined as a merge of both changes.
In scope were the following modified or added files:
packages
└── core
└── dispute-router
└── src
└── DisputeRouter.solUpdate: The in-scope code, including all fixes, was subsequently published to the public UMAprotocol/protocol repository in pull request #4991 at commit 4f1bf8a. The packages/core/dispute-router/ directory at this commit is byte-for-byte identical to the final reviewed commit c95f28b of the private repository, and compiling DisputeRouter and DisputeRouterCouncil at both commits with the same compiler settings and dependency versions produces identical bytecode. This review was limited to the in-scope code, and the integration of this code with other parts of the public repository was not assessed.
System Overview
DisputeRouter is an upgradeable oracle that sits between UMA's Optimistic Oracle contracts on Polygon and OracleChildTunnel, which bridges price requests to the DVM on Ethereum. Once the Finder Oracle entry points to the router, disputed requests are cached in the router, where a council can resolve them locally. Requests that are not resolved locally are forwarded to the underlying oracle after a configurable delay by any account, or earlier by the council. Prices are served from a local council resolution first and, for forwarded requests, from the underlying oracle.
The audited changes add two mechanisms:
- Legacy Oracle Fallback: An immutable
legacyOracle, set in the implementation constructor, is queried for requests that the router has never received. This allows disputes raised before the Finder cutover, which remain in the previous oracle, to settle through the router. - Forwarding Budget: A per-block limit on forwarding calls (one by default) is shared by automatic, public, and council-initiated forwarding. When the forwarding delay is zero and the limit is reached, the dispute remains cached and must be forwarded in a later block. The budget counts calls only and does not bound the size of the Polygon transaction that carries the bridge message.
DisputeRouterCouncil, which is typically configured as the router's council, was not modified. Its interaction with the changed router was reviewed as context.
Security Model and Trust Assumptions
Router Owner: Can upgrade the implementation, replace the council and the underlying oracle, and set the forwarding delay and the per-block budget. The owner is trusted to configure these values correctly. In particular:
- New implementations are expected to preserve the
finderandlegacyOracleimmutables, as the upgrade path does not enforce this and omitting the legacy oracle prevents pre-cutover disputes from settling. - The underlying oracle is expected to be replaced only after forwarded requests have settled, as their prices are always read from the current oracle and a misconfigured one causes their settlement to revert.
- Changes to the forwarding delay apply to all pending requests, so lowering it immediately allows any account to forward requests that the council has not yet reviewed.
- The underlying oracle is expected to remain the legacy oracle until all pre-cutover disputes have settled.
Council: Can resolve any cached request that has not been forwarded to an arbitrary price, and can forward requests before the delay elapses. The council is trusted to resolve requests correctly and to forward those it cannot resolve. Council forwarding consumes the shared budget and reverts when the budget for the current block is spent.
Registered Contracts: Only contracts registered in the UMA Registry can submit requests and read prices. They are trusted to be legitimate UMA products. Requests are keyed by identifier, time, and ancillary data only, so identical requests from different contracts share a single entry.
Forwarders: Any account can forward a request once the delay has elapsed. This is not a specific role, and the router does not constrain the transaction in which the bridge message is emitted.
Underlying and Legacy Oracles: Both are trusted to answer requests correctly, and the router must be registered with each of them. The router has no way to retry or undo a forward if the bridge message is not delivered.
Medium Severity
Any Account Can Strand a Dispute by Forwarding It in a Padded Transaction
Once forwardDelay has elapsed, any account can call the forwardPriceRequest function of the DisputeRouter contract. This makes OracleChildTunnel emit the bridge message for the dispute within the caller's transaction. To deliver that message, OracleRootTunnel must receive an exit proof on Ethereum. The getReceipt function of ExitPayloadReader takes the complete receipt of the Polygon transaction from the proof, and getLog selects the message from its list of logs. That complete receipt is then verified against the checkpointed receipt root. Therefore, the proof must include every log emitted in the transaction, and its verification cost on Ethereum grows with them.
An attacker can thus forward a victim's dispute from a contract that emits a large volume of junk logs in the same transaction. Emitting logs on Polygon is cheap, but proving the resulting receipt on Ethereum can exceed the transaction gas limit. The forward cannot be undone: forwardedTimestamp is set permanently, the council can no longer resolve the request, and OracleChildTunnel never re-emits the message. The dispute therefore does not reach the DVM through the bridge, and its bonds and rewards remain locked until it is recovered manually on Ethereum. Before the router, only the disputer controlled this transaction. Furthermore, PR #22 extends the issue to passthrough mode, since a dispute deferred by the per-block budget can later be forwarded by anyone. The README acknowledges unrelated receipt padding, but not that it can be targeted at a specific dispute or how such a dispute is recovered.
Consider having the council forward every dispute it does not resolve locally before forwardDelay elapses, so that the permissionless path is only used as a fallback, and keeping a non-zero forwardDelay on Polygon. In addition, consider documenting the manual recovery procedure for stranded disputes, in which the price is requested directly from the DVM through OracleHub using the compressed ancillary data emitted by OracleChildTunnel, and then relayed back to Polygon through OracleRootTunnel.
Update: Acknowledged, not resolved. The team stated:
“We are keeping forwarding permissionless afterforwardDelayand accepting the remaining receipt-padding risk. We have not added a function to resetforwardedTimestamp.”
“PR #25 documents keeping a nonzero delay on Polygon, having the council forward unresolved disputes before it expires, monitoring delivery, and recovering an undelivered request throughOracleHub.requestPricefollowed byOracleRootTunnel.publishPrice, using the exact compressedparentAncillaryDatafromPriceRequestAdded.”
“It also adds a pinned Ethereum/Polygon fork test. The test passed (1 passed, 0 failed, 0 skipped): it leaves a public forward unrelayed, checks real OracleHub/DVM admission, publishes the answer through the deployed root tunnel, delivers its actual StateSynced payload through FxChild, and verifies that the router returns the price with its forwarding state unchanged. The DVM answer is mocked and system delivery is impersonated. It does not reproduce the padding attack or test OO bond settlement; the Store fee is zero at the pinned block.”
Low Severity
Incompatibilities on Chains Other Than Polygon
The DisputeRouter contract can front any oracle that implements OracleAncillaryInterface, but two of its assumptions only hold on Polygon:
- The per-block forwarding budget is keyed on
block.number. On Arbitrum,block.numberreturns an approximation of the Ethereum block number, so the budget would apply per Ethereum block rather than per L2 block. Arbitrum block number can be obtained by callingarbBlockNumberon theArbSysprecompiled contract. - The router only implements the ancillary-data interface. However,
OracleSpoke, which serves as the oracle on other L2s, also exposes the two-argumentrequestPrice,hasPriceandgetPricefunctions used by older financial contracts. Pointing the Finder to the router on such a chain would cause these callers to revert.
Consider documenting that the router is intended for Polygon only, or addressing both points before deploying it on other chains.
Update: Resolved in pull request #26 at commit bec4b52. The team stated:
“The README now explicitly limits this deployment to Polygon and documents both points to revisit before deploying elsewhere: Arbitrum'sblock.numbersemantics and the missing two-argumentrequestPrice,hasPrice, andgetPriceoverloads. We have not added support for other chains.”
Documentation and Readability Gaps
Throughout the codebase, multiple opportunities to improve documentation and readability were identified:
- The README does not mention
setForwardBudgetin the admin interface or the router owner role, and does not listForwardBudget.t.solamong the tests. Its Registry setup example passes abytes32[]toregisterContract, which expects anaddress[]. It describesLEGACY_ORACLEas optional although omitting it disables settlement of pre-cutover disputes through the router. - The
forwardBudgetandsetForwardBudgetfunctions ofDisputeRouter, as well as the_getDvmRequestTimestampand_requireDisputedEventBasedManagedRequestfunctions ofDisputeRouterCouncil, do not document all of their parameters or return values. - The
priceRequests,operators, andearlyRequestIdentifiersmappings do not use named parameters. - Neither contract specifies a security contact through the
@custom:security-contactNatSpec tag.
Consider updating the README to reflect the current implementation, completing the NatSpec documentation, adding named mapping parameters, and including a security contact in each contract.
Update: Resolved in pull request #27 at commit d6672de. The team stated:
“The README now includessetForwardBudgetin the admin interface and owner role, listsForwardBudget.t.sol, usesaddress[]in the Registry example, and clarifies thatLEGACY_ORACLEis needed to settle pre-cutover disputes through the router.”
“The PR also completes the noted NatSpec parameters/returns, names the mapping parameters, and adds the existing UMA security-reporting contact to both contracts. Contract/script build, formatting, and diff checks pass.”
Notes & Additional Information
Router Admission Can Temporarily Hide Legacy Oracle Prices
The _getPriceOrError function only consults legacyOracle for requests that are absent from the router. However, the _requestPrice function admits a request without checking whether the legacy oracle has already answered it. If a requester submits the same question after the cutover on a different Optimistic Oracle flavor, the legacy price becomes unreadable until the request is forwarded. Furthermore, if the forwarding oracle differs from the legacy oracle at that point, the forward opens a second DVM request for an already answered question.
Consider documenting that the forwarding oracle must remain the legacy oracle until all pre-cutover disputes have settled, including for any later setOracle call. Consider also monitoring for admitted requests that the legacy oracle already prices, so that they can be escalated promptly.
Update: Resolved in pull request #28 at commit b8ab8e8. The team stated:
“Addressed through the recommended operational documentation in PR #28. It requires keepingORACLE = LEGACY_ORACLEuntil all pre-cutover disputes have settled, including when considering latersetOraclecalls.”
“It also documents monitoring newly admitted requests for an existing legacy price and promptly escalating them through the council, subject to available forwarding budget. With both oracle addresses aligned, escalation restores access to the existing price without creating a second DVM request. Request-admission behavior is unchanged.”
Finder Cutover Is Not Immediate for OptimisticOracleV3
The README describes switching the Finder Oracle entry to the router as the cutover step. However, OptimisticOracleV3 stores the oracle address in cachedOracle and only refreshes it when the permissionless syncUmaParams function is called. Until then, its disputes continue to bypass the router, and the moment at which they start using the router is chosen by whoever calls syncUmaParams.
Consider documenting that syncUmaParams must be called as part of the cutover for every deployed OptimisticOracleV3 instance.
Update: Resolved in pull request #29 at commit 8b9a6b0. The team stated:
“The cutover procedure now explicitly calls forsyncUmaParams(identifier, currency)on every deployed OOv3 instance and verification thatcachedOraclepoints to the router. It also explains why the Finder update alone is insufficient and why the sync should be part of the cutover.”
Single-Step Ownership Transfers
The DisputeRouter and DisputeRouterCouncil contracts inherit single-step ownership, and the deployment script transfers ownership of both contracts in a single call. Since the router owner also authorizes upgrades, a transfer to an incorrect address, or an accidental call to renounceOwnership, would permanently remove the ability to upgrade or configure the router.
Consider using Ownable2StepUpgradeable and Ownable2Step, and overriding renounceOwnership to revert.
Update: Resolved in pull request #31 at commit 1b29a3a. The team stated:
“The router now usesOwnable2StepUpgradeable, the council usesOwnable2Step, andrenounceOwnershipreverts on both contracts.”
“Deployment output and the README now distinguish the current and pending owner and require acceptOwnership() on both contracts when the combined deployment initiates a handoff. The existing router Ownable storage namespace is preserved.”“All 81 router/council/budget tests pass, including the new ownership acceptance and renunciation checks. Contract/script build and formatting checks also pass.”
Reverting the Finder Cutover Strands Router Requests
PR #18 allows the router to serve requests that were raised before the Finder cutover through legacyOracle. However, no equivalent path exists in the opposite direction. If the Finder Oracle entry is pointed back to OracleChildTunnel, e.g., as an emergency rollback, the Optimistic Oracle contracts query the tunnel directly. Prices resolved by the council are stored only in the router, and resolved requests cannot be forwarded. Likewise, requests that were admitted but not yet forwarded never reached the tunnel. Disputes in either state would therefore remain unsettled, and their bonds would stay locked, until the Finder is pointed back to the router.
Consider documenting a rollback procedure that ensures that all council-resolved disputes have settled and all pending requests have been forwarded before the Finder is changed.
Update: Resolved in pull request #30 at commit 8ab6a24. The team stated:
“The README now describes the rollback prerequisites: settle all council-resolved disputes and forward all pending router requests before switching Finder back to OracleChildTunnel, retrying across blocks as needed for the forwarding budget.”“It explains the consequences of rolling back early and requires refreshing each OOv3 instance's oracle cache after the Finder change.”
Conclusion
DisputeRouter places a council-controlled dispute path in front of UMA's Optimistic Oracle on Polygon. OpenZeppelin audited two pull requests that add a legacy oracle fallback for the Finder cutover and a shared per-block forwarding budget.
Both changes are contained in a single contract and extend the existing namespaced storage without altering its layout. There are few operational assumptions that are not enforced onchain, such as preserving the implementation immutables across upgrades and keeping the underlying oracle aligned with the legacy oracle until pre-cutover disputes have settled. Documenting these assumptions as part of the cutover procedure is advisable.
In addition to a few low-severity and informational issues, the most notable finding concerns public forwarding. Since any account can choose the Polygon transaction that carries a forwarded request, a dispute may be forwarded as part of a transaction whose receipt is too large to be proven on Ethereum. The router provides no mechanism to recover from such a scenario.
The UMA team is appreciated for their responsiveness and cooperation throughout this engagement.
Appendix
Issue Classification
OpenZeppelin classifies smart contract vulnerabilities on a 5-level scale:
- Critical
- High
- Medium
- Low
- Note/Information
Critical Severity
This classification is applied when the issue’s impact is catastrophic, threatening extensive damage to the client's reputation and/or causing severe financial loss to the client or users. The likelihood of exploitation can be high, warranting a swift response. Critical issues typically involve significant risks such as the permanent loss or locking of a large volume of users' sensitive assets or the failure of core system functionalities without viable mitigations. These issues demand immediate attention due to their potential to compromise system integrity or user trust significantly.
High Severity
These issues are characterized by the potential to substantially impact the client’s reputation and/or result in considerable financial losses. The likelihood of exploitation is significant, warranting a swift response. Such issues might include temporary loss or locking of a significant number of users' sensitive assets or disruptions to critical system functionalities, albeit with potential, yet limited, mitigations available. The emphasis is on the significant but not always catastrophic effects on system operation or asset security, necessitating prompt and effective remediation.
Medium Severity
Issues classified as being of medium severity can lead to a noticeable negative impact on the client's reputation and/or moderate financial losses. Such issues, if left unattended, have a moderate likelihood of being exploited or may cause unwanted side effects in the system. These issues are typically confined to a smaller subset of users' sensitive assets or might involve deviations from the specified system design that, while not directly financial in nature, compromise system integrity or user experience. The focus here is on issues that pose a real but contained risk, warranting timely attention to prevent escalation.
Low Severity
Low-severity issues are those that have a low impact on the client's operations and/or reputation. These issues may represent minor risks or inefficiencies to the client's specific business model. They are identified as areas for improvement that, while not urgent, could enhance the security and quality of the codebase if addressed.
Notes & Additional Information Severity
This category is reserved for issues that, despite having a minimal impact, are still important to resolve. Addressing these issues contributes to the overall security posture and code quality improvement but does not require immediate action. It reflects a commitment to maintaining high standards and continuous improvement, even in areas that do not pose immediate risks.