---
id: "CVE-2026-125208"
page: "https://infrastack.ai/live/CVE-2026-125208"
kind: "vulnerability"
aliases: ["CVE-2026-125208"]
title: "FFmpeg: crafted video causes out-of-bounds write during V4L2 encoding"
severity: "high"
cvss: 7.3
epss: null
exploited: false
status: "open"
category: "runtime"
products: [{"name": "ffmpeg", "fixed": [], "affected": "<= 9.0.2 (V4L2 M2M encoder only)", "ecosystem": "vendor"}]
ecosystems: []
tags: ["ffmpeg", "linux", "runtime", "v4l2", "video-encoding"]
not_affected_if: ["no-v4l2-encoding", "trusted-input-only"]
published_at: "2026-11-09T19:16:57+00:00"
first_seen_at: "2026-11-09T19:28:18+00:00"
updated_at: "2026-11-09T19:34:54+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-125208", "first_seen_at": "2026-11-09T19:28:18+00:00"}, {"source": "analyst", "url": null, "first_seen_at": "2026-11-09T19:34:54+00:00"}]
exploit_sources: []
---

# FFmpeg: crafted video causes out-of-bounds write during V4L2 encoding

Link for people: https://infrastack.ai/live/CVE-2026-125208 (this .md is for agents)

FFmpeg through 9.0.2 has an out-of-bounds write in the V4L2 M2M encoding path, where plane offsets are not checked against the buffer length. A crafted video with specific dimensions or padding can make memcpy() write past the driver buffer, which can corrupt memory.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- vendor:ffmpeg affected <= 9.0.2 (V4L2 M2M encoder only) fixed no fixed version listed

## How to check

- Run `ffmpeg -version`; versions up to and including 9.0.2 are listed as affected.
- Run `ffmpeg -encoders | grep v4l2m2m`; if no *_v4l2m2m encoder is listed, or you never use one, the vulnerable path is not used.
- If you build from source, check whether libavcodec/v4l2_buffers.c contains commit b8f1598 (v4l2_buffer_swframe_to_single_buffer).

## Fix

No fixed release named in the sources. The fix is upstream commit b8f159858e2fd29dae4fa34d9e713bbf9bbf190e (libavcodec/v4l2_buffers.c, 'fixing buffer alignment issue'), which validates layout against the V4L2 buffer length before copying. Until a release containing it ships, build from a master that includes the commit or avoid V4L2 M2M encoding.

## Timeline

- 2026-11-09T19:28:18+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-125208
- 2026-11-09T19:34:54+00:00 analyst — Read FFmpeg commit b8f1598 (maintainer patch, adds bounds checks in new v4l2_buffer_swframe_to_single_buffer) and VulnCheck advisory (FFmpeg <= 9.0.2, no fixed release named, no exploitation or PoC stated). Fixed release unknown; settle by checking FFmpeg release tags after 9.0.2. Nothing marked verified.

## Documents

- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/ffmpeg-through-9.0.2-v4l2-m2m-encoder-out-of-bounds-write-in-v4l2-buffers-c
- [fix] Patch: github.com https://github.com/FFmpeg/FFmpeg/commit/b8f159858e2fd29dae4fa34d9e713bbf9bbf190e

## From the sources

FFmpeg through 9.0.2 contains an out-of-bounds write vulnerability in v4l2_buffer_swframe_to_buf() in libavcodec/v4l2_buffers.c because cumulative plane offsets are not checked against the V4L2 buffer length. Attackers can supply crafted video whose dimensions or padding cause unsigned wraparound in v4l2_bufref_to_buf(), making memcpy() write past the mmaped driver buffer during V4L2 M2M encoding.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
