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/build_provenance_tail_watch.py

Python · 9,480 bytes
#!/usr/bin/env python3
"""Prepare an old-SDK one-byte tail-access diagnostic; never launch Paint.

The only target is the pinned outer_xlbox_plus1 fixture. It allocates 0xC7B7
bytes but the first APP11 stream read copies 0xC7B6. A data breakpoint is
armed on the last, uncopied byte at parser +0xC986A, after retrieval and
before JUMBF deserialization. The breakpoint records the first CPU read or
write; it cannot by itself classify an access as a read.
"""

from __future__ import annotations

import argparse
import json
from dataclasses import asdict
from pathlib import Path

import pefile

from build_provenance_deep_traces import DEEP
from build_provenance_heap_diagnostics import SDK_SHA256
from generate_cdb import Checkpoint, POINTS, ROOT, VERSION, executable_rva, render, sha256


EXPECTED_TARGET_SHA256 = "131f3b706393e45dfc161034dcbdc85a35d1c35dd97cfb6bafbcdde44b95bd74"
EXPECTED_CONTROL_SHA256 = "75a8da33f6eaf1e16bf3b42cd78913b22b2e6a671fda217a508b1ba4230ce864"
COPIED_BYTES = 0xC7B6
REPORTED_BYTES = COPIED_BYTES + 1
PINS = {
    0xC9826: "ff15f4571900",   # first stream read into the allocation
    0xC982C: "483bc6",         # compare returned stream count
    0xC9856: "4c8930",         # publish allocation pointer
    0xC986A: "488901",         # publish declared/reported length
    0x1732DC: "48833f04",     # compare logical remaining with four-byte LBox
    0x1732E0: "0f8374010000", # jump to LBox load only when remaining >= 4
    0x1732FE: "c7458f24000000", # status 36 on short LBox
}


def build(output: Path) -> dict[str, object]:
    sdk = ROOT / "packages" / VERSION["old"] / "x64/PaintApp/provenancesdk.dll"
    if not sdk.is_file() or sha256(sdk) != SDK_SHA256:
        raise ValueError("Signed old SDK digest differs")
    pe = pefile.PE(str(sdk), fast_load=True)
    try:
        for rva, expected in PINS.items():
            opcode = bytes.fromhex(expected)
            if not executable_rva(sdk, rva) or pe.get_data(rva, len(opcode)) != opcode:
                raise ValueError(f"Signed opcode differs at +0x{rva:X}")
    finally:
        pe.close()

    fixture_dir = ROOT / "lab/corpus/provenance_outer_frontier/generated"
    target = fixture_dir / "outer_xlbox_plus1.jpg"
    control = ROOT / "lab/corpus/generated/40_official_c2pa_jpeg.jpg"
    if sha256(target) != EXPECTED_TARGET_SHA256 or sha256(control) != EXPECTED_CONTROL_SHA256:
        raise ValueError("Pinned target or control fixture differs")

    points = [p for p in POINTS["old"]
              if p.path in {"image", "flow", "provenance"}
              and p.label not in {"box_header", "sdk_init_result"}]
    points += [p for p in DEEP["old"]
               if p.label in {"file_reader", "retrieval_entry", "retrieval_return"}]
    modules: dict[str, dict[str, str]] = {}
    for point in points:
        binary = ROOT / "packages" / VERSION["old"] / "x64/PaintApp" / point.module
        if not binary.is_file() or not executable_rva(binary, point.rva):
            raise ValueError(f"Missing signed code site: {point.module}+0x{point.rva:X}")
        modules[point.module] = {
            "package_path": str(binary.relative_to(ROOT)).replace("\\", "/"),
            "sha256": sha256(binary),
        }

    script = render("old", points, auto_continue=True, ignore_winui_rpc=True,
                    skip_breakpoint_listing=True)
    anchor = "sxd 8001010e\n"
    if script.count(anchor) != 1 or not script.endswith("g\n"):
        raise ValueError("Unexpected base debugger script")
    script = script.replace(
        anchor, anchor +
        'sxd -c2 ".echo PAINT_TAIL_SECOND_CHANCE_CPP; .exr -1; '
        'kv 16; lmv m provenancesdk; .echo PAINT_TAIL_SECOND_CHANCE_END; gn" e06d7363\n'
        'r $t0 = 0\n'
        'r $t1 = 0\n', 1)

    # bu201 only fires for the target's reported length. The watchpoint is
    # installed after the first copy and before the caller deserializes it.
    # ba r1 is read/write on x64; log the instruction to classify a hit.
    # Escape CDB's nested CommandString quotes one level at a time.
    def quoted(command: str) -> str:
        return '"' + command.replace('"', '\\"') + '"'

    def pid(label: str) -> str:
        return f'.printf "PAINT_TRACE_HIT_PID=tail_{label}:%u\\n", @$tpid'

    watch_command = (
        ".echo PAINT_TAIL_BYTE_ACCESS; ~.; r rip; u @rip L2; "
        "kv 12; bd 200; g"
    )
    arm_command = (
        f".echo PAINT_TRACE_HIT=tail_watch_arm; {pid('watch_arm')}; ~.; "
        "r $t0 = @r14; r $t1 = @r14 + 0xC7B6; r r14; r r13; r rax; "
        f"ba200 r1 @$t1 {quoted(watch_command)}; "
        ".echo PAINT_TAIL_WATCHPOINT_ARMED_LIST_BEGIN; bl; "
        ".echo PAINT_TAIL_WATCHPOINT_ARMED_LIST_END; bc 201; g"
    )
    arm = f'bu201 /w "@rax == 0xC7B7" provenancesdk+0xC986A {quoted(arm_command)}'
    # The signed header parser can run many times; MASM .if gates the log to
    # the one-byte tail while keeping this breakpoint armed until that state.
    # The prior /w condition gave a false match at the first full-span header.
    guard_command = (
        f".if ((poi(@rdi) == 1) & (poi(@rsi) == @$t1)) {{ "
        f".echo PAINT_TRACE_HIT=tail_short_lbox_guard; {pid('short_lbox_guard')}; ~.; "
        "dq @rdi L1; dq @rsi L1; r rip; u @rip L3; kv 12; bc 202 }; g"
    )
    guard = f'bu202 provenancesdk+0x1732DC {quoted(guard_command)}'
    reject_command = (
        f".echo PAINT_TRACE_HIT=tail_short_lbox_status36; {pid('short_lbox_status36')}; ~.; "
        "dq @rdi L1; dq @rsi L1; r rip; u @rip L2; kv 12; g"
    )
    reject = f'bu203 /1 provenancesdk+0x1732FE {quoted(reject_command)}'
    result_command = (
        f".echo PAINT_TRACE_HIT=tail_sdk_status36; {pid('sdk_status36')}; ~.; r eax; "
        ".echo PAINT_TAIL_WATCHPOINT_FINAL_LIST_BEGIN; bl; "
        ".echo PAINT_TAIL_WATCHPOINT_FINAL_LIST_END; "
        ".if (@$t1 != 0) { bc 200 }; bc 204; g"
    )
    result = f'bu204 /w "@eax == 0x24" ProvenanceHelper+0x49EA {quoted(result_command)}'
    script = script[:-2] + "\n".join((arm, guard, reject, result)) + (
        "\n.echo PAINT_TAIL_INITIAL_BREAKPOINT_LIST_BEGIN\nbl\n"
        ".echo PAINT_TAIL_INITIAL_BREAKPOINT_LIST_END\ng\n"
    )
    if any(script.count(f"bu{bp} ") != 1 for bp in (201, 202, 203, 204)):
        raise ValueError("Tail profile does not have one of each target breakpoint")
    if script.count("ba200 r1") != 1 or script.count("bd 200") != 1:
        raise ValueError("Tail hardware watchpoint arm/disable is missing")

    output.parent.mkdir(parents=True, exist_ok=True)
    output.write_text(script, encoding="ascii")
    manifest: dict[str, object] = {
        "profile": "old", "version": VERSION["old"], "script": output.name,
        "diagnostic_mode": "outer-xlbox-plus1-tail-watch", "auto_continue": True,
        "exception_continuation": "unhandled", "signed_sdk_sha256": SDK_SHA256,
        "control_sha256": EXPECTED_CONTROL_SHA256,
        "target_sha256": EXPECTED_TARGET_SHA256,
        "copied_bytes": COPIED_BYTES, "reported_bytes": REPORTED_BYTES,
        "tail_offset": COPIED_BYTES,
        "pinned_instruction_bytes": {f"0x{k:X}": v for k, v in PINS.items()},
        "modules": modules,
        "checkpoints": [asdict(p) | {"rva": f"0x{p.rva:X}"} for p in points] + [
            {"path": "tail", "label": "watch_arm", "module": "provenancesdk.dll",
             "rva": "0xC986A", "purpose": "Arm one-byte data breakpoint after first copy"},
            {"path": "tail", "label": "short_lbox_guard", "module": "provenancesdk.dll",
             "rva": "0x1732DC", "purpose": "Check remaining one byte at tail cursor"},
            {"path": "tail", "label": "short_lbox_status36", "module": "provenancesdk.dll",
             "rva": "0x1732FE", "purpose": "Reject short LBox with status 36"},
            {"path": "tail", "label": "sdk_status36", "module": "ProvenanceHelper.dll",
             "rva": "0x49EA", "purpose": "Observe SDK status 36 and watchpoint state"},
        ],
        "special_breakpoints": {
            "arm": "provenancesdk+0xC986A conditional RAX=0xC7B7",
            "watch": "ba200 r1 allocation_base+0xC7B6; read/write",
            "guard": "provenancesdk+0x1732DC with remaining=1 at tail cursor",
            "reject": "provenancesdk+0x1732FE with remaining=1 at tail cursor",
            "result": "ProvenanceHelper+0x49EA conditional EAX=36",
        },
        "limits": [
            "Stage the valid control then outer_xlbox_plus1, each in a fresh Paint process.",
            "An absent tail-access marker is interpretable only when the armed hardware breakpoint appears in both CDB breakpoint lists and the SDK result is observed.",
            "ba r1 catches reads and writes; classify any hit from the stopped instruction.",
            "The short-LBox comparison is a guard, not a sampled byte read.",
            "No guest, Paint process, or debugger is started by this builder.",
            "Raw addresses, process memory, screenshots, and CDB logs remain local.",
        ],
    }
    output.with_suffix(output.suffix + ".json").write_text(
        json.dumps(manifest, indent=2) + "\n", encoding="utf-8")
    return manifest


def main() -> None:
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("--output", type=Path, required=True)
    args = parser.parse_args()
    manifest = build(args.output)
    print(f"Wrote {args.output} ({len(manifest['checkpoints'])} base checkpoints)")


if __name__ == "__main__":
    main()