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

Python · 5,109 bytes
#!/usr/bin/env python3
"""Offline contract for the narrow signed ext-heap bounds profile."""

from __future__ import annotations

import json
import re
import shutil
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path


HERE = Path(__file__).resolve().parent
sys.path.insert(0, str(HERE))

import build_provenance_missing_bounds_r2 as target  # noqa: E402
from generate_cdb import ROOT, VERSION  # noqa: E402
from validate_focus_profile_contract import verify_contract  # noqa: E402


SIGNED_OLD = ROOT / "packages" / VERSION["old"] / "x64/PaintApp/provenancesdk.dll"


class NarrowBoundsTests(unittest.TestCase):
    @unittest.skipUnless(SIGNED_OLD.is_file(), "Signed old Paint package is local-only")
    def test_signed_narrow_profile_and_guest_contract(self) -> None:
        with tempfile.TemporaryDirectory() as directory:
            path = Path(directory) / "old.auto.cdb.txt"
            profile = target.build(path)
            script = path.read_text(encoding="ascii")
            self.assertEqual(profile["schema"],
                             "paint-provenance-old-missing-bounds-profile-v2")
            self.assertEqual(len(profile["checkpoints"]), 22)
            self.assertEqual(profile["max_total_custom_hits"], 128)
            self.assertEqual(profile["heap_extension_sha256"], target.EXT_SHA256)
            self.assertEqual(script.count("!ext.heap -p -a"), 4)
            self.assertIn(r".load C:\PaintLab\Input\debugger\winext\ext.dll", script)
            self.assertNotIn("!heap -p -a", script)
            self.assertNotIn("bounds_serializer_entry", script)
            self.assertNotIn("bounds_serializer_output", script)
            self.assertNotIn("bounds_writer_memcpy_call", script)
            self.assertEqual(set(re.findall(r"PAINT_TRACE_HIT=([a-z0-9_]+);", script)),
                             {f"{p['path']}_{p['label']}" for p in profile["checkpoints"]})
            verify_contract(profile, script, build="old",
                            module_names=tuple(profile["modules"]))
            self.assertEqual(json.loads(Path(str(path) + ".json").read_text()),
                             profile)

    def test_stage_requires_pinned_extensions_and_does_not_launch(self) -> None:
        stage = (HERE / "stage_provenance_missing_bounds_r2.ps1").read_text()
        self.assertIn("-DebuggerHeapExtensions", stage)
        self.assertIn("R2 requires pinned full PageHeap", stage)
        self.assertIn("-FocusCases $focusCases", stage)
        self.assertIn("if ($ValidateOnly)", stage)
        self.assertNotIn("Start-Process", stage)

    @unittest.skipUnless(sys.platform == "win32" and SIGNED_OLD.is_file(),
                         "Host CDB smoke requires signed Windows package")
    def test_host_cdb_resolves_explicit_ext_heap_command(self) -> None:
        debugger = Path(r"C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe")
        compiler = shutil.which("gcc")
        if not debugger.is_file() or compiler is None:
            self.skipTest("Host CDB or GCC unavailable")
        source = (
            "__declspec(dllexport) __attribute__((noinline)) void marker(void) "
            "{ volatile int x=0; x++; }\n"
            "int main(void) { marker(); return 0; }\n"
        )
        with tempfile.TemporaryDirectory() as directory:
            temp = Path(directory)
            c_file, executable = temp / "smoke.c", temp / "smoke.exe"
            c_file.write_text(source, encoding="ascii")
            built = subprocess.run([compiler, str(c_file), "-O0", "-g", "-o",
                                    str(executable)], capture_output=True,
                                   text=True, timeout=20, check=False)
            self.assertEqual(built.returncode, 0, built.stdout + built.stderr)
            profile = temp / "old.auto.cdb.txt"
            target.build(profile)
            command = next(line for line in profile.read_text(encoding="ascii").splitlines()
                           if line.startswith("bu904 "))
            command = (command
                       .replace("provenancesdk+0x161BD0", "smoke!marker", 1)
                       .replace("provenancesdk+0x170F71", "poi(@rsp)", 1)
                       .replace("lmv m provenancesdk", "lmv m smoke", 1))
            smoke = temp / "smoke.cdb.txt"
            smoke.write_text(
                f".load {target.EXT_DLL}\n" + "r $t0 = 0\n" + command + "\ng\nq\n",
                encoding="ascii")
            run = subprocess.run([str(debugger), "-cf", str(smoke), str(executable)],
                                 capture_output=True, text=True, timeout=30, check=False)
            combined = run.stdout + run.stderr
            self.assertEqual(run.returncode, 0, combined[-2500:])
            self.assertIn("PAINT_TRACE_HIT=bounds_id_source_read", combined)
            self.assertNotIn("the `!heap -p' commands in exts.dll have been replaced", combined)
            self.assertNotIn("Malformed string", combined)
            self.assertNotIn("Syntax error", combined)


if __name__ == "__main__":
    unittest.main()