---
id: "CVE-2026-125204"
page: "https://infrastack.ai/live/CVE-2026-125204"
kind: "vulnerability"
aliases: ["CVE-2026-125204"]
title: "FFmpeg: crafted media overflows heap in libwebp encoder, crashing apps"
severity: "high"
cvss: 7.3
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["ffmpeg", "media-pipeline", "runtime", "self-hosted"]
not_affected_if: ["cr-threshold-unset", "no-libwebp-encoder", "trusted-input-only"]
published_at: "2026-11-09T19:16:56+00:00"
first_seen_at: "2026-11-09T19:28:18+00:00"
updated_at: "2026-11-09T19:30:09+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-125204", "first_seen_at": "2026-11-09T19:28:18+00:00"}]
exploit_sources: []
---

# FFmpeg: crafted media overflows heap in libwebp encoder, crashing apps

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

FFmpeg through 9.0.2 has a heap buffer overflow in the libwebp encoder path when cr_threshold is set. Crafted media that increases resolution mid-stream makes memcpy() write past a stale reference frame, corrupting memory and crashing the application.

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

## How to check

- Check the installed FFmpeg version with `ffmpeg -version`, and compare it against the fixed version in the patch linked from the NVD entry.
- Look for libwebp encoding in use: `ffmpeg -encoders | grep webp` shows whether the libwebp encoder is built in.
- Check whether any pipeline passes `cr_threshold` to the WebP encoder.

## Fix

- FFmpeg: upgrade past `9.0.2` to the patched release referenced in the linked upstream patch (exact fixed version not stated in the sources).

## Timeline

- 2026-11-09T19:28:18+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-125204

## Documents

- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/ffmpeg-through-9.0.2-heap-buffer-overflow-in-libwebp-encoder-conditional-replenishment
- [fix] Patch: github.com https://github.com/FFmpeg/FFmpeg/commit/9b99973b2bbecee0b7e1e57035b95498b42f54a6

## From the sources

FFmpeg through 9.0.2 contains a heap buffer overflow in ff_libwebp_get_frame() in libwebpenc_common.c that lets attackers corrupt memory when cr_threshold is set. Attackers can supply crafted media that increases resolution mid-stream, causing memcpy() to write pixel data past the stale reference frame and crash applications.

---

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