| Title | FFmpeg (FFmpeg project) FFmpeg — libavcodec MSCC decoder (libavcodec/mscc.c) ffmpeg version 8.0.git MSCC-UE-1 — Uninitialized / Stale Heap Memory Disclosure |
|---|
| Description | MSCC-UE-1 is an uninitialized/stale heap memory disclosure (CWE-908, secondary CWE-200) in FFmpeg's MSCC decoder (libavcodec/mscc.c). Three behaviors combine: (1) decode_init() allocates s->uncomp_buf with av_malloc() and never zeroes it; the buffer is reused across frames. (2) rle_uncompress() treats the RLE end-marker 00 01 as successful completion at any point in the stream, without checking that the expected frame output has been fully produced; unlike running out of input mid-operation (which correctly returns AVERROR_INVALIDDATA at mscc.c:131), the explicit end-marker bypasses that protection. (3) decode_frame() treats that success as a complete frame and copies the entire expected buffer into the output AVFrame (mscc.c:198-206). An MSCC stream can therefore stop before writing the complete frame while FFmpeg still exports the unwritten portion of s->uncomp_buf. In a reused decoder buffer, those bytes may contain data left by an earlier frame or another allocation.
Reproduction with the stock FFmpeg CLI and default options: a two-frame AVI where frame 1 paints the full 128×128 frame with 0xDD and frame 2's RLE stream is only 00 01. The decoder emits frame 2 as a full frame; 128/128 rows are recovered from frame 1's data. An ASan build (malloc fill 0xbe) with a single end-marker-only frame exposes 10 rows of never-written 0xbe plus 1 mixed boundary row (buffer rows 0–9 map to output rows 118–127 due to the bottom-up copy; 4096/384 ≈ 10.67). A control with the same marker after full 0xCC coverage yields 128/128 correct rows and zero 0xbe, proving the marker itself is harmless and the leak depends on early termination. The issue reproduces on a normal build without sanitizer errors. Extended tests show cross-file disclosure in a persistent-process harness (127/128 planted rows, 3/3 deterministic trials) and an attacker-controlled disclosure boundary (exact 64/64 fresh/stale split with mscc-ue-1-partial64.avi).
Impact: stale heap contents reach decoded frames; previous-frame and previously processed file data can be recovered; the disclosure boundary is attacker-controlled; behavior is deterministic under tested conditions. Highest impact is in persistent services that decode multiple files in one process.
Affected: FFmpeg master snapshot 2026-09-26 ("ffmpeg version 8.0.git"), MD5(libavcodec/mscc.c) = fd1e48985bd631a1665031c546a597b1; earlier versions containing the same decoder logic are likely affected. Suggested direction (not an approved patch): validate produced output before returning success, and/or zero-initialize the intermediate buffer as defense-in-depth. Report ID FF-SECREV-2026-MSCC-01; privately submitted for coordinated disclosure; CVE assignment pending. |
|---|
| Source | ⚠️ https://gist.github.com/yxxx21635-tech/2c0334803a096e8b8ee5f00ec6c08852 |
|---|
| User | zerOiQ (UID 102613) |
|---|
| Submission | 10/29/2026 22:09 (28 days ago) |
|---|
| Moderation | 11/26/2026 22:00 (28 days later) |
|---|
| Status | Duplicate |
|---|
| VulDB entry | 433259 [FFmpeg up to 9.0.2 MSCC/SRGC decoder libavcodec/mscc.c information disclosure] |
|---|
| Points | 0 |
|---|