Root cause: React Router's lazy route discovery ('fog of war') turns a single attacker-controlled pathname into many route look-ups. getPathsWithAncestors (Framework/RSC) and getPartialManifest (Framework SSR) walk every ancestor prefix of the request path and match each one against the route tree, and the regex-based matcher (V6RegExMatcher/matchRoutesImpl) scans candidate branches whose metadata size is matchCost. Because the number of prefixes grows linearly with the number of path segments an attacker can supply, and each match costs O(matchCost), a request to a very deep path (e.g. /1/2/3/.../N with N large) forces O(segments x matchCost) work on the server with no authentication and no bound, yielding denial of service (CWE-400 / CWE-407). The exposed server-side entry points are getRenderPayload in RSC mode (document and .rsc data requests) and handleDocumentRequest (nested renderHtml) in Framework Mode SSR with lazy discovery enabled. The patch (#15703 on main, #15704 backport to v7) does NOT try to sanitise the pathname; instead it adds shouldUseInitialRouteDiscovery, which estimates the cumulative ancestor work and the regex match cost, and when the budget is exceeded it locally switches the response to routeDiscovery.mode = 'initial' so the server renders the full manifest and skips the unbounded expansion. V6RegExMatcher.update/matchCost and createStaticHandler._matchCost are only the instrumentation introduced by the fix to feed that estimate and are therefore mitigation code, not vulnerable code. In a runtime profiler you would see the request handler, the expansion helpers (getPathsWithAncestors, getPartialManifest), the patch drivers (getRenderPayload/getAdditionalRoutePatches for RSC, handleDocumentRequest/renderHtml for Framework) and the matcher internals as the CPU hot path while the crafted deep URL is processed.