CVE-2026-65706

FFmpeg 3.0 - 8.1.2 vf_swaprect Out-of-Bounds Write via NV12 Frame Processing

Published Jul 23, 2026 CVSS 4.0 · 8.5 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability in the ffmpeg video filtering component (vf_swaprect) arises from an out‑of‑bounds memory write. A crafted NV12 video frame with an odd width can trigger a 17‑byte memcpy into a 17‑byte buffer, corrupting the heap. If the process memory is overwritten, the attacker could potentially execute arbitrary code or cause a crash. This flaw is a classic instance of an unchecked buffer size assumption (CWE‑131) combined with an improper memory copy (CWE‑787).

Affected Systems

FFmpeg versions 3.0 through 8.1.2 are affected. The vulnerability is present in all builds that include the vf_swaprect filter in these releases. No vendor‑specific patches have been released yet, so any system running ffmpeg in this version range is at risk.

Risk and Exploitability

The CVSS score of 8.5 places the issue in the high severity range, and the EPSS score of less than 1 % indicates a relatively low likelihood of exploitation at present. The vulnerability is not listed in the CISA KEV catalog. Exploitability requires the attacker to supply a malicious NV12 frame to ffmpeg, which could occur when the software processes untrusted video streams or media files. The crafted frame triggers a 17‑byte memcpy into a 17‑byte buffer, corrupting heap memory and causing a process crash with potential for code execution. Therefore, the risk is significant for systems that process untrusted NV12 frames, but the overall probability of exploitation remains limited by current usage patterns.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to the latest FFmpeg release that addresses the vf_swaprect out‑of‑bounds write.
  • If an upgrade is not feasible, disable the vf_swaprect filter or restrict ffmpeg to process only trusted NV12 frames within your environment.
  • Continuously monitor ffmpeg logs for abnormal crashes and apply additional runtime hardening such as stack canaries.

Generated by OpenCVE AI on August 4, 2026 at 15:13 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-8716-2 FFmpeg vulnerabilities
History
Type Values Removed Values Added
CPEs cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Ffmpeg
Ffmpeg ffmpeg
Vendors & Products Ffmpeg
Ffmpeg ffmpeg
Type Values Removed Values Added
Description 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.
Title FFmpeg 3.0 - 8.1.2 vf_swaprect Out-of-Bounds Write via NV12 Frame Processing
Weaknesses CWE-131
CWE-787
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.5, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Weaknesses
  • CWE-131

    Incorrect Calculation of Buffer Size

  • CWE-787

    Out-of-bounds Write

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Jul 28, 2026, 1:06 AM
Reserved
Jul 22, 2026, 8:26 PM
Status
Analyzed
Published
Jul 23, 2026, 8:17 PM
Modified
Oct 24, 2026, 3:10 PM
Severity
Moderate
Public date
Jul 23, 2026, 7:05 PM