CVE-2026-70631 in FFmpeg
Summary
by MITRE • 08/07/2026
FFmpeg versions from 0.5 up to, but not including, 9.0 contain an uninitialized heap memory disclosure vulnerability in the native TIFF decoder in libavcodec/tiff.c. An attacker who can cause FFmpeg to decode a crafted TIFF file can supply a valid Deflate-compressed strip that terminates successfully after producing fewer bytes than the declared strip requires. The tiff_unpack_zlib() function allocates a heap buffer sized for the full declared strip but copies all declared rows via memcpy() regardless of how many bytes zlib actually decompressed, causing unwritten bytes that can contain stale data from prior heap allocations to be incorporated into decoded image output and potentially exposing sensitive data in persistent services.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 08/07/2026
This vulnerability exists within FFmpeg's native TIFF decoder implementation in libavcodec/tiff.c affecting versions from 0.5 through 8.9.99. The flaw stems from improper memory handling during Deflate-compressed strip decompression where the tiff_unpack_zlib() function allocates heap memory based on the full declared strip size but fails to account for the actual number of bytes produced by zlib decompression operations. When a crafted TIFF file contains a valid Deflate-compressed strip that terminates successfully but produces fewer bytes than declared, the system copies all declared rows using memcpy() without verifying the actual decompressed byte count, resulting in uninitialized heap memory being included in the final decoded output.
The technical exploitation occurs when FFmpeg processes maliciously constructed TIFF files where the Deflate compression stream completes successfully but generates fewer output bytes than specified in the strip metadata. The heap buffer allocation accounts for the maximum possible strip size as declared in the file headers, yet the memcpy() operation proceeds regardless of how many actual bytes were decompressed by zlib. This discrepancy leaves uninitialized memory regions within the allocated buffer containing data from previous heap allocations, which then becomes part of the final decoded image data. The vulnerability represents a classic case of improper initialization and memory boundary checking that allows information leakage through uninitialized memory contents.
The operational impact is significant for persistent services that process untrusted TIFF files, including web applications, content management systems, and media processing pipelines. When such services decode malicious TIFF files without proper validation or sanitization, they become vulnerable to information disclosure attacks where sensitive data from previous heap allocations may be exposed in the decoded output images. This vulnerability can potentially expose cryptographic keys, user credentials, temporary passwords, or other confidential information that happened to reside in the uninitialized memory regions at the time of allocation. The risk is particularly elevated in server environments where FFmpeg processes files from untrusted sources without proper input validation.
Mitigation strategies should focus on input validation and proper memory boundary checking within the TIFF decoder implementation. The most effective approach involves modifying the tiff_unpack_zlib() function to track the actual number of bytes decompressed by zlib and ensure that memcpy() operations only copy the verified decompressed data rather than copying the full buffer size. Additionally, implementing strict bounds checking on decompression operations and validating strip metadata against actual decompressed output sizes would prevent this uninitialized memory disclosure. The fix should align with CWE-1287 standards for proper handling of compressed data streams and follow ATT&CK technique T1552.001 for protecting stored credentials through proper memory management practices. Organizations should also consider implementing input sanitization layers, restricting FFmpeg usage to trusted inputs only, and monitoring for unusual decompression patterns in processing pipelines to detect potential exploitation attempts.