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

Python · 4,924 bytes
#!/usr/bin/env python3
"""Check selected signed old-SDK PNG caBX producer and copy instructions.

This verifies a pinned DLL's instruction/branch anchors only. It is not a
whole-program proof of PNG parser safety or a runtime allocation trace.
"""

from __future__ import annotations

import argparse
import hashlib
import struct
from pathlib import Path

import pefile


SHA256 = "339d8f47ea7bcc08b0c1f122a1e94d5d31860f1ad1ccf7faea1625ffd6de3904"
IMAGE_BASE = 0x180000000

INSTRUCTIONS: dict[int, str] = {
    0xCE77F: "ff159b081900",   # PNG 4-byte big-endian length read
    0xCE785: "83f804",         # require complete length
    0xCE7E4: "0fc9",           # byte-swap input length
    0xCDB89: "8b7df0",        # current chunk declared length
    0xCDB90: "83c70c",        # add 12-byte chunk framing in 32 bits
    0xCDD6D: "8bd7",          # pass that total to node constructor
    0xCDD6F: "44887c2420",    # flag zero for this new node
    0xCD04B: "e8208bf3ff",   # allocate passed length
    0xCD058: "48894810",      # node +0x10 = data buffer
    0xCD0C5: "4c897818",      # node +0x18 = passed length
    0xCD0D8: "0fb68c24c0000000",  # load caller-provided transform flag
    0xCD0E8: "884820",        # node +0x20 = transform flag
    0xCDDCC: "4c8b4a18",      # request exact node length
    0xCDDD3: "488b5210",      # read into node data buffer
    0xCDDDB: "ff153f121900",  # stream Read
    0xCDDE5: "483b4718",      # compare actual count with node length
    0xCDDE9: "7455",          # equal count reaches success path
    0xCDE40: "44387f20",      # test node transform flag
    0xCDE44: "0f84d2feffff",  # zero flag returns node without transform
    0xCE930: "8b0532531000",  # caBX type constant
    0xCE936: "3b01",          # select caBX chunk
    0xCE973: "488b4118",      # node length
    0xCE977: "4883f80c",      # require length greater than 12
    0xCE97B: "7758",          # only then enter data copy
    0xCE9D5: "8d68f4",        # output size = length - 12
    0xCE9DC: "e88f71f3ff",   # allocate output size
    0xCEA4C: "488b5010",     # source = node buffer
    0xCEA50: "4883c208",     # source += 8; leave trailing 4-byte CRC
    0xCEA54: "e877700d00",   # copy exactly length - 12
}

REL32_TARGETS: dict[int, tuple[int, int]] = {
    0x7030: (0xE9, 0xCD900),
    0x9690: (0xE9, 0xCE830),
    0x3EF0: (0xE9, 0xCCF40),
    0xCDD77: (0xE8, 0x3EF0),
    0xCE9DC: (0xE8, 0x5B70),
    0xCEA54: (0xE8, 0x1A5AD0),
}

VTABLE_PRODUCER_RVA = 0x1D1DC8
VTABLE_CONSUMER_RVA = 0x1D1DD8
TYPE_NAME_RVA = 0x242F78
CHUNK_TYPE_RVA = 0x1D3C68


def relative_target(rva: int, data: bytes, opcode: int) -> int:
    if len(data) != 5 or data[0] != opcode:
        raise ValueError(f"unexpected relative branch at RVA 0x{rva:x}")
    return rva + 5 + struct.unpack_from("<i", data, 1)[0]


def verify_sites(read_rva, image_base: int = IMAGE_BASE) -> tuple[int, int]:
    for rva, expected_hex in INSTRUCTIONS.items():
        expected = bytes.fromhex(expected_hex)
        if read_rva(rva, len(expected)) != expected:
            raise ValueError(f"instruction mismatch at RVA 0x{rva:x}")
    for rva, (opcode, expected_target) in REL32_TARGETS.items():
        if relative_target(rva, read_rva(rva, 5), opcode) != expected_target:
            raise ValueError(f"branch mismatch at RVA 0x{rva:x}")
    producer = struct.unpack("<Q", read_rva(VTABLE_PRODUCER_RVA, 8))[0]
    consumer = struct.unpack("<Q", read_rva(VTABLE_CONSUMER_RVA, 8))[0]
    if (producer, consumer) != (image_base + 0x7030, image_base + 0x9690):
        raise ValueError("PNG parser vtable mismatch")
    if read_rva(TYPE_NAME_RVA, len(b".?AVPNGProvenanceParser@@\0")) != b".?AVPNGProvenanceParser@@\0":
        raise ValueError("PNG parser RTTI name mismatch")
    if read_rva(CHUNK_TYPE_RVA, 4) != b"caBX":
        raise ValueError("PNG caBX type mismatch")
    return len(INSTRUCTIONS), len(REL32_TARGETS)


def main() -> int:
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("--dll", type=Path, required=True, help="locally held signed old x64 SDK")
    args = parser.parse_args()
    data = args.dll.read_bytes()
    if hashlib.sha256(data).hexdigest() != SHA256:
        parser.error("DLL SHA-256 differs from the pinned old x64 build")
    pe = pefile.PE(data=data, fast_load=True)
    if pe.OPTIONAL_HEADER.Magic != 0x20B or pe.FILE_HEADER.Machine != 0x8664:
        parser.error("expected a PE32+ x64 module")

    def read_rva(rva: int, size: int) -> bytes:
        result = pe.get_data(rva, size)
        if len(result) != size:
            raise ValueError(f"RVA 0x{rva:x} is truncated")
        return result

    instructions, branches = verify_sites(read_rva, pe.OPTIONAL_HEADER.ImageBase)
    print(f"Pinned old SDK PNG caBX anchors verified: {instructions} instructions, {branches} branches, 4 data anchors.")
    return 0


if __name__ == "__main__":
    raise SystemExit(main())