CVE-2026-137911 in FFmpeginfo

Summary

by MITRE • 11/27/2026

FFmpeg before 9.1 contains an out-of-bounds read vulnerability in xwd_encode_frame() in libavcodec/xwdenc.c that copies each RGB24 or BGR24 row using the padded XWD scanline size instead of the pixel row size. Attackers who control the width of video encoded to XWD by an application that supplies tightly packed frames can make the encoder read past the frame buffer, crashing the application or leaking heap contents into the output image.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 11/27/2026

The vulnerability identified in FFmpeg versions prior to 9.1 represents a critical memory safety flaw located within the libavcodec library, specifically affecting the XWD (X Window Dump) video encoder implementation found in xwdenc.c. This issue manifests as an out-of-bounds read condition during the encoding process of RGB24 or BGR24 pixel formats. The root cause lies in a fundamental miscalculation regarding memory allocation and access boundaries when handling frame data. Specifically, the function xwd_encode_frame incorrectly utilizes the padded XWD scanline size rather than the actual pixel row size to determine how much data to copy for each video row. In image processing standards such as those defined by the X Window System, scanlines are often padded with zero bytes to align memory addresses on word boundaries, typically 32-bit or 64-bit words. However, when an application supplies tightly packed frames where no padding exists between rows, this logic error causes the encoder to assume a larger row width than is actually present in the source buffer.

From a technical perspective, this discrepancy leads directly to heap-based out-of-bounds reads as classified under CWE-125: Out-of-bounds Read. When an attacker controls or influences the width parameter of the video being encoded, they can craft inputs that exploit this mismatch. Because the encoder attempts to copy more bytes per row than are available in the tightly packed frame buffer, it inevitably reads past the allocated memory region associated with the current frame. This behavior violates standard memory safety principles and exposes the application to severe security risks. The immediate operational impact includes the potential for denial of service through application crashes due to segmentation faults or access violations triggered by reading unmapped memory pages. Furthermore, in more sophisticated attack scenarios, this out-of-bounds read can facilitate information disclosure attacks where sensitive heap contents are leaked into the output image file. Such leaks could expose internal application states, cryptographic keys, or other private data residing adjacent to the frame buffer in memory.

This vulnerability aligns with common exploitation patterns observed in multimedia processing software and maps to specific techniques within the MITRE ATT&CK framework. The ability to read arbitrary heap memory corresponds to Tactic TA0042: Resource Development if used for reconnaissance, or more directly relates to data exfiltration methods where sensitive information is extracted from running processes. Additionally, the crash capability falls under Denial of Service tactics, specifically targeting application availability through resource exhaustion or unexpected termination. The flaw highlights a common pitfall in C/C++ programming where assumptions about memory layout and padding are not rigorously validated against actual input constraints. Developers often assume standard alignment practices without verifying whether the source data adheres to those expectations, leading to buffer over-reads when inputs deviate from the assumed format.

Mitigation strategies for this vulnerability primarily involve upgrading FFmpeg to version 9.1 or later, where the xwd_encode_frame function has been corrected to accurately calculate row sizes based on actual pixel dimensions rather than padded scanline widths. For organizations unable to immediately patch their systems, implementing strict input validation is critical. Applications should ensure that any video frames passed to the encoder are properly aligned and padded according to XWD specifications before encoding begins. Alternatively, applications can enforce tighter constraints on width parameters or switch to alternative container formats that do not rely on such padding assumptions. Security teams should also monitor for unusual memory access patterns in logs associated with FFmpeg processes, as these may indicate attempted exploitation of this out-of-bounds read condition. Regular security audits focusing on buffer boundary checks in multimedia libraries are essential to prevent similar vulnerabilities from being introduced or exploited in the future.

Responsible

AISLE

Reservation

11/27/2026

Disclosure

11/27/2026

Moderation

accepted

CPE

ready

EPSS

0.00195

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!