CVE-2026-65706 in FFmpeginfo

Summary

by MITRE • 07/23/2026

FFmpeg versions 3.0 through 8.1.2 contain an out-of-bounds write vulnerability in the vf_swaprect video filter that allows attackers to corrupt heap memory by supplying a crafted NV12 video frame with odd width dimensions. The filter_frame() function reuses a temporary row buffer sized for plane 0's single-byte pixel step across all planes, causing an 18-byte memcpy into a 17-byte heap allocation when processing the two-byte-per-sample interleaved chroma plane of a 17x16 NV12 frame, resulting in heap corruption and process crash with potential for code execution.

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

Analysis

by VulDB Data Team • 07/23/2026

This vulnerability resides within the FFmpeg multimedia framework's video filtering subsystem where the vf_swaprect filter processes video frames through the filter_frame() function. The flaw manifests specifically when handling NV12 format video frames with odd width dimensions, creating a critical out-of-bounds write condition that can lead to heap memory corruption. The vulnerability stems from improper buffer sizing calculations within the filter implementation where a temporary row buffer designed for single-byte pixel steps is incorrectly reused across multiple planes of the video frame structure. This design flaw directly violates the principle of proper memory allocation and boundary checking as outlined in CWE-129 and CWE-787, creating a scenario where memory access exceeds allocated boundaries.

The technical execution of this vulnerability requires crafting a specific NV12 video frame with dimensions of 17x16 pixels, where the odd width creates an imbalance in the pixel step calculations across different planes. The NV12 format consists of two separate planes - a luma plane with single-byte samples and a chroma plane with interleaved two-byte samples. When the filter processes this specific frame size, it attempts to copy 18 bytes of data into a heap allocation that only contains 17 bytes, resulting in a precise 1-byte overflow. This memory corruption occurs because the temporary buffer sizing logic fails to account for the different pixel step requirements between planes, particularly when the chroma plane's two-byte per sample requirement conflicts with the luma plane's single-byte assumption.

The operational impact of this vulnerability extends beyond simple process crashes to potentially enable remote code execution within applications that utilize FFmpeg for video processing. Attackers can leverage this vulnerability by providing maliciously crafted video files to applications such as media players, video editing software, or web browsers that rely on FFmpeg's library components. The heap corruption can lead to arbitrary code execution when the corrupted memory locations are subsequently accessed during normal program operation, making this a critical security concern for any system processing untrusted video content. This vulnerability directly maps to ATT&CK technique T1203 by enabling privilege escalation through code execution, and represents a classic buffer overflow scenario that can be exploited for remote compromise.

Mitigation strategies for this vulnerability require immediate patching of FFmpeg installations to versions 8.1.3 or later where the buffer sizing logic has been corrected to properly account for different pixel step requirements across video planes. System administrators should also implement input validation controls that reject video files with unusual dimensions or malformed frame structures before they reach the FFmpeg processing pipeline. Additional protective measures include running applications with reduced privileges, implementing memory protection mechanisms such as stack canaries and address space layout randomization, and monitoring for unusual memory access patterns that could indicate exploitation attempts. The vulnerability highlights the importance of proper buffer management in multimedia processing libraries and demonstrates how seemingly minor implementation flaws can create significant security risks when combined with specific input conditions that trigger the corrupted execution path.

Responsible

VulnCheck

Reservation

07/22/2026

Disclosure

07/23/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!