Exploit database

GH-945bd5267b0d1b94c3f74faf5cda7e5a

blkph0x/cve-2026-83844_poc

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-83844

5 sources

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

Repository files579
blkph0x/cve-2026-83844_pocRevision 193ed44859da
Next files →

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

lab/trace/review_provenance_e_header_heap.py

Python · 5,764 bytes
#!/usr/bin/env python3
"""Reduce one private Batch E CDB header-copy heap report to geometry only.

This is deliberately independent of the signed profile/guest identity reviewer.
It verifies the reported backend allocation and selected copy address relation;
it cannot establish that the guest loaded the expected fixture or signed module.
No process address, memory byte, or local path is emitted.
"""

from __future__ import annotations

import argparse
import json
from pathlib import Path
import re


MARKER = re.compile(r"(?m)^PAINT_TRACE_HIT=(echild_[a-z0-9_]+)\r?$")
HEX = r"(?:0x)?([0-9a-fA-F`]+)"
PINNED_CHUNK_BYTES = 51_136
PINNED_UNUSED_BYTES = 2


def _one(pattern: str, text: str, label: str) -> str:
    found = re.findall(pattern, text, re.IGNORECASE | re.MULTILINE)
    if len(found) != 1:
        raise ValueError(f"Missing or ambiguous {label}")
    return found[0]


def _hex(pattern: str, text: str, label: str) -> int:
    return int(_one(pattern, text, label).replace("`", ""), 16)


def _field(section: str, marker: str, field: str) -> int:
    return _hex(
        rf"PAINT_ECHILD_VALUE={re.escape(marker)}\.{re.escape(field)}:"
        rf"([0-9a-fA-F`]+)",
        section,
        f"{marker}.{field}",
    )


def review_header_copy(log: str) -> dict[str, object]:
    """Return only derived allocation/copy scalars; fail on ambiguous input."""
    if re.search(r"Unable to bind name|condition did not evaluate|Syntax error", log,
                 re.IGNORECASE):
        raise ValueError("Debugger condition or syntax diagnostic present")
    markers = list(MARKER.finditer(log))
    labels = [hit.group(1) for hit in markers]
    selected = "echild_selected_header_call"
    copy = "echild_header_copy_call"
    returned = "echild_header_copy_return"
    if any(labels.count(name) != 1 for name in (selected, copy, returned)):
        raise ValueError("Selected header or copy marker is not unique")
    positions = {name: labels.index(name) for name in (selected, copy, returned)}
    if not positions[selected] < positions[copy] < positions[returned]:
        raise ValueError("Selected header/copy marker order differs")

    def section(name: str) -> str:
        index = positions[name]
        start = markers[index].end()
        end = markers[index + 1].start() if index + 1 < len(markers) else len(log)
        return log[start:end]

    call = section(selected)
    copied = section(copy)
    base = _field(call, selected, "base")
    reader_length = _field(call, selected, "length")
    call_cursor = _field(call, selected, "cursor")
    source = _field(copied, copy, "source")
    copy_width = _field(copied, copy, "width")
    copy_cursor = _field(copied, copy, "cursor")
    if not 0 < copy_width <= 8 or call_cursor != copy_cursor or \
            source != base + copy_cursor:
        raise ValueError("Reader cursor/source/copy width differs")

    begin = copied.find("PAINT_ECHILD_HEAP_BEGIN=echild_header_copy_call")
    end = copied.find("PAINT_ECHILD_HEAP_END=echild_header_copy_call")
    if begin < 0 or end <= begin or \
            copied.count("PAINT_ECHILD_HEAP_BEGIN=echild_header_copy_call") != 1 or \
            copied.count("PAINT_ECHILD_HEAP_END=echild_header_copy_call") != 1:
        raise ValueError("Heap report boundaries missing or ambiguous")
    report = copied[begin:end]
    searched = _hex(r"Search was performed for the following Address:\s*"
                    + HEX, report, "heap search address")
    chunk_header = _hex(r"Chunk header address\s*:\s*" + HEX,
                        report, "chunk header")
    chunk_size = int(_one(r"Chunk size \(bytes\)\s*:\s*(\d+)",
                          report, "chunk size"))
    unused = int(_one(r"Chunk unused bytes\s*:\s*(\d+)",
                      report, "chunk unused bytes"))
    _one(r"The address was found in backend heap\.", report, "backend heap")
    _one(r"Allocation status\s*:\s*Variable size allocated chunk\.",
         report, "allocated variable-size chunk")
    if searched != source or chunk_size != PINNED_CHUNK_BYTES or \
            unused != PINNED_UNUSED_BYTES or base != chunk_header + 16:
        raise ValueError("Pinned backend allocation geometry differs")
    user_end = chunk_header + chunk_size - unused
    user_bytes = user_end - base
    if user_bytes != reader_length:
        raise ValueError("Backend user extent differs from reader length")
    remaining_after_copy = user_end - (source + copy_width)
    return {
        "schema": "paint-provenance-e-header-heap-geometry-v1",
        "measurement_only": True,
        "backend_allocated_variable_size_chunk": True,
        "chunk_size_bytes": chunk_size,
        "chunk_unused_bytes": unused,
        "chunk_header_to_reader_base_bytes": 16,
        "backend_user_extent_bytes": user_bytes,
        "reader_length_bytes": reader_length,
        "copy_cursor_bytes": copy_cursor,
        "copy_width_bytes": copy_width,
        "bytes_from_copy_end_to_user_end": remaining_after_copy,
        "copy_within_backend_user_extent": remaining_after_copy >= 0,
        "claim_limit": "One selected header-copy source span only; not a parser-wide read census.",
    }


def main() -> None:
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("--log", type=Path, required=True,
                        help="Private CDB log; its path and addresses are never emitted")
    args = parser.parse_args()
    try:
        log = args.log.read_text(encoding="utf-8-sig", errors="replace")
        result = review_header_copy(log)
    except (OSError, ValueError) as exc:
        raise SystemExit(f"Inconclusive private heap geometry: {exc}") from None
    print(json.dumps(result, indent=2))


if __name__ == "__main__":
    main()