Exploit databaseDownload repository ZIP
GH-945bd5267b0d1b94c3f74faf5cda7e5a
blkph0x/cve-2026-83844_poc
Sources for CVE-2026-83844
5 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files579
blkph0x/cve-2026-83844_pocRevision 193ed44859da
- ↑..Parent directory
- afl_emf_gdiplus/
- capture/
- generated/
- BFDB_ALLOCATOR_REUSE_PROTOCOL.md
- BFDB_AUTHORING_MEDIA_STATIC.md
- BFDB_AUTHORING_PROTOCOL.md
- BFDB_BOUNDED_MARKER_PLACEMENT_PROTOCOL.md
- BFDB_BYTE_PROVENANCE_PROTOCOL.md
- BFDB_CACHE_PROTOCOL.md
- BFDB_CLOCK_ONLY_CONTROL_PROTOCOL.md
- BFDB_CROSSSLOT_PROTOCOL.md
- BFDB_FAST_FIRST_OPEN_PROTOCOL.md
- BFDB_FOUR_WPR_PROTOCOL.md
- BFDB_GEOMETRY_GUEST_PROTOCOL.md
- BFDB_LFH_CHECKPOINT_PROTOCOL.md
- BFDB_MARKER_ACCEPTANCE.md
- BFDB_MARKER_FIRSTOPEN_SEMANTIC_GATE.md
- BFDB_MARKER_FOUR_FIRSTOPEN_PROTOCOL.md
- BFDB_MARKER_FOUR_PROTOCOL.md
- BFDB_MARKER_ROUTE_CONTROL.md
- BFDB_MARKER_SEMANTIC_GATE.md
- BFDB_NORMAL_EXTENT_PROTOCOL.md
- BFDB_NORMAL_HEAP_PROTOCOL.md
- BFDB_NORMAL_RECORD_PROTOCOL.md
- BFDB_OUTPUT_GATES_PROTOCOL.md
- BFDB_POSTOPEN_PROTOCOL.md
- BFDB_SDK_RESOLUTION_SCAN.md
- BFDB_SINK_GATE_PROTOCOL.md
- BFDB_VALIDATION_LIFETIME_PROTOCOL.md
- BFDB_WPR_HEAP_PROTOCOL.md
- BRUSH_DISPATCH_PROTOCOL.md
- COLD_ATTACH_REPAIR_PLAN.md
- EMF_BFDB_FUZZ_ANALYSIS.md
- EMF_BFDB_FUZZ_BATCH_PROTOCOL.md
- EMF_BFDB_FUZZ_CAMPAIGN.md
- EMF_BFDB_SEQUENCE_PROTOCOL.md
- EMF_BFDB_WARM_PAGEHEAP_PROTOCOL.md
- EMF_CLIPBOARD_VALID_PROTOCOL.md
- EMF_VALID_ACCEPTANCE_PROTOCOL.md
- FILL_LOOP_CENSUS_PROTOCOL.md
- FILL_MOUSE_EVENT_PROTOCOL.md
- FILL_TOUCH_INPUT_PROTOCOL.md
- FILL_WIN32_DISPATCH_PROTOCOL.md
- PROVENANCE_APP11_POSTSEEK_PROTOCOL.md
- PROVENANCE_APP11_READER_SCAN_PROTOCOL.md
- PROVENANCE_APP11_SPLIT_NEW_LABEL_GUARD_PROTOCOL.md
- PROVENANCE_BATCH_E_SUBSET_PROTOCOL.md
- PROVENANCE_COPY_REOPEN_PROTOCOL.md
- PROVENANCE_E_CHILD_DECISION_PROTOCOL.md
- PROVENANCE_FIELD_ID_CONSUMER_PROTOCOL.md
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
lab/trace/test_bfdb_byte_provenance.py
Python · 9,105 bytes#!/usr/bin/env python3
"""Offline failure gates for the bounded media/tree comparison."""
from __future__ import annotations
import unittest
from pathlib import Path
from tempfile import TemporaryDirectory
from build_bfdb_byte_provenance import (
TREE_BYTES, TREE_CAPTURE_RELATIVE, _check_allocation_pins, extend,
)
from review_bfdb_byte_provenance import (
PrivateRun, allocated_tree_chunk, compare_pair, read_tree_capture,
requested_heap_extent, tree_allocation_extent,
)
BASE = (
'bu /1 provenancesdk+0x8FF16 ".echo PAINT_TRACE_HIT=bfdb_memcpy_return; g"\n'
'bu /1 ProvenanceHelper+0x4A31 ".echo PAINT_BFDB_OUT_EVENT=tree_before; r rip; g"\n'
'g\n'
)
def run(case: str, suffix: bytes | None, tree: bytes | None,
source: bytes = b"source") -> PrivateRun:
return PrivateRun({
"case_id": case,
"same_process_tree_handoff": True,
"media_requested_extent": "sample_inside_reported_request",
"tree_capture": "complete_live_vector" if tree is not None else "not_observed",
}, suffix, tree, source)
class ProfileTests(unittest.TestCase):
def test_two_live_points_and_fixed_cap(self) -> None:
text = extend(BASE)
self.assertEqual(text.count("PAINT_BFDB_BYTES_MEDIA_BEGIN"), 1)
self.assertEqual(text.count("PAINT_BFDB_BYTES_TREE_BEGIN"), 1)
self.assertEqual(text.count(".writemem"), 1)
self.assertIn(f"L0x{TREE_BYTES:X}", text)
self.assertIn("$vvalid", text)
self.assertIn("r rip; g", text)
self.assertIn("PAINT_BFDB_BYTES_TREE_WRITE_ATTEMPTED", text)
self.assertNotIn("PAINT_BFDB_BYTES_TREE_WRITTEN", text)
self.assertIn(".writemem C:/PaintLab/Output/bfdb-capture/live-tree.bin", text)
self.assertNotIn(r".writemem C:\PaintLab", text)
self.assertEqual(text.count("bu /1 ProvenanceHelper+0x2A36"), 1)
self.assertEqual(text.count("bu /1 ProvenanceHelper+0x2A3B"), 1)
def test_signed_allocation_opcodes(self) -> None:
_check_allocation_pins()
def test_missing_live_point_fails(self) -> None:
with self.assertRaises(ValueError):
extend(BASE.replace("0x4A31", "0x4A32"))
class HeapExtentTests(unittest.TestCase):
REPORT = ("Search was performed for the following Address: 0x1010\n"
"Allocation status: LFH Allocated\n"
"User requested size: 24 Bytes\n"
"Unused bytes: 8 Bytes\n"
"Block Address: 0x1000\n"
"Block Size: 32 Bytes\n"
"Subsegment Size: 32 Bytes\n")
def test_requested_end_uses_reported_request(self) -> None:
block, end, kind = requested_heap_extent(self.REPORT, 0x1010)
self.assertEqual((block, end, kind), (0x1000, 0x1018, "LFH Allocated"))
def test_wrong_search_address_fails(self) -> None:
with self.assertRaises(ValueError):
requested_heap_extent(self.REPORT, 0x1011)
def test_inconsistent_unused_bytes_fails(self) -> None:
with self.assertRaises(ValueError):
requested_heap_extent(self.REPORT.replace("8 Bytes", "7 Bytes"), 0x1010)
class CaptureFileTests(unittest.TestCase):
RUNTIME = ("PAINT_BFDB_BYTES_TREE_HEAP_END\n"
"PAINT_BFDB_BYTES_TREE_WRITE_ATTEMPTED\n")
def test_attempt_without_file_is_incomplete(self) -> None:
with TemporaryDirectory() as folder:
with self.assertRaisesRegex(ValueError, "missing or wrong size"):
read_tree_capture(self.RUNTIME, Path(folder))
def test_empty_precaptured_file_is_incomplete(self) -> None:
with TemporaryDirectory() as folder:
path = Path(folder) / TREE_CAPTURE_RELATIVE
path.parent.mkdir()
path.touch()
with self.assertRaisesRegex(ValueError, "missing or wrong size"):
read_tree_capture(self.RUNTIME, Path(folder))
def test_exact_sized_capture_is_required(self) -> None:
with TemporaryDirectory() as folder:
path = Path(folder) / TREE_CAPTURE_RELATIVE
path.parent.mkdir()
path.write_bytes(b"A" * TREE_BYTES)
self.assertEqual(read_tree_capture(self.RUNTIME, Path(folder)), b"A" * TREE_BYTES)
def test_debugger_error_overrides_existing_exact_file(self) -> None:
with TemporaryDirectory() as folder:
path = Path(folder) / TREE_CAPTURE_RELATIVE
path.parent.mkdir()
path.write_bytes(b"A" * TREE_BYTES)
runtime = self.RUNTIME.replace("PAINT_BFDB_BYTES_TREE_WRITE_ATTEMPTED",
"Unable to create file\n"
"PAINT_BFDB_BYTES_TREE_WRITE_ATTEMPTED")
with self.assertRaisesRegex(ValueError, "failed or skipped"):
read_tree_capture(runtime, Path(folder))
class AllocationBindingTests(unittest.TestCase):
TREE = ("PAINT_BFDB_BYTES_TREE_PID:0x111\n"
"PAINT_BFDB_BYTES_TREE_TID:0x222\n"
"PAINT_BFDB_BYTES_TREE_OBJECT:0x3000\n"
"PAINT_BFDB_BYTES_TREE_PTR:0x4000\n"
"PAINT_BFDB_BYTES_TREE_END:0x10788\n"
"Search was performed for the following Address: 0x4000\n"
"Allocation status: Variable size allocated chunk.\n"
"Chunk header address: 0x3fd0\n"
"Chunk size (bytes): 51168\n"
"Chunk unused bytes: 33\n")
RUNTIME = ("PAINT_BFDB_BYTES_ALLOC_CALL\n"
"PAINT_BFDB_BYTES_ALLOC_CALL_PID:0x111\n"
"PAINT_BFDB_BYTES_ALLOC_CALL_TID:0x222\n"
"PAINT_BFDB_BYTES_ALLOC_CALL_OBJECT:0x3000\n"
"PAINT_BFDB_BYTES_ALLOC_CALL_REQUEST:0xC788\n"
"PAINT_BFDB_BYTES_ALLOC_RETURN\n"
"PAINT_BFDB_BYTES_ALLOC_RETURN_PID:0x111\n"
"PAINT_BFDB_BYTES_ALLOC_RETURN_TID:0x222\n"
"PAINT_BFDB_BYTES_ALLOC_RETURN_OBJECT:0x3000\n"
"PAINT_BFDB_BYTES_ALLOC_RETURN_REQUEST:0xC788\n"
"PAINT_BFDB_BYTES_ALLOC_RETURN_BEGIN:0x4000\n"
"PAINT_BFDB_BYTES_TREE_BEGIN\n")
def test_exact_call_return_and_chunk_binding(self) -> None:
self.assertEqual(tree_allocation_extent(self.RUNTIME, self.TREE,
0x4000, 0x10788),
"call_return_request_covers_live_vector")
self.assertEqual(allocated_tree_chunk(self.TREE, 0x4000, 0x10788),
"allocated_chunk_membership_only")
def test_wrong_return_pointer_fails(self) -> None:
changed = self.RUNTIME.replace("RETURN_BEGIN:0x4000", "RETURN_BEGIN:0x5000")
with self.assertRaises(ValueError):
tree_allocation_extent(changed, self.TREE, 0x4000, 0x10788)
def test_wrong_object_fails(self) -> None:
changed = self.RUNTIME.replace("ALLOC_CALL_OBJECT:0x3000",
"ALLOC_CALL_OBJECT:0x3008")
with self.assertRaises(ValueError):
tree_allocation_extent(changed, self.TREE, 0x4000, 0x10788)
def test_wrong_request_fails(self) -> None:
changed = self.RUNTIME.replace("ALLOC_RETURN_REQUEST:0xC788",
"ALLOC_RETURN_REQUEST:0xC780")
with self.assertRaises(ValueError):
tree_allocation_extent(changed, self.TREE, 0x4000, 0x10788)
def test_chunk_report_short_fails(self) -> None:
with self.assertRaises(ValueError):
allocated_tree_chunk(self.TREE.replace("51168", "50000"),
0x4000, 0x10788)
class PairTests(unittest.TestCase):
def test_absent_suffix_is_bounded_to_complete_tree(self) -> None:
result = compare_pair(run("control", None, b"no marker"),
run("trigger", b"UNIQUE01", b"no marker"))
self.assertEqual(result["pair_category"],
"exact_suffix_absent_from_complete_trigger_tree")
self.assertEqual(result["paint_visible_disclosure"], "not_established")
def test_match_requires_distinct_source_and_control(self) -> None:
result = compare_pair(run("control", None, b"no marker"),
run("trigger", b"UNIQUE01", b"UNIQUE01"))
self.assertEqual(result["pair_category"],
"candidate_internal_tree_transfer_requires_provenance")
def test_input_match_is_ambiguous(self) -> None:
result = compare_pair(run("control", None, b"no marker"),
run("trigger", b"UNIQUE01", b"UNIQUE01",
b"source UNIQUE01"))
self.assertEqual(result["pair_category"],
"suffix_match_not_attributable_to_overread")
def test_missing_capture_never_becomes_negative(self) -> None:
result = compare_pair(run("control", None, b"no marker"),
run("trigger", b"UNIQUE01", None))
self.assertEqual(result["pair_category"],
"incomplete_no_negative_inference")
if __name__ == "__main__":
unittest.main()