CVE-2026-125255
FFmpeg through 9.0.2 contains a use after free vulnerability in libavcodec/mjpegdec.c that allows attackers to trigger freed buffer reads by sending a SOF mark…
Impact
FFmpeg through 9.0.2 contains a use after free vulnerability in libavcodec/mjpegdec.c that allows attackers to trigger freed buffer reads by sending a SOF marker without a preceding SOI. Attackers can supply crafted MJPEG streams causing ff_mjpeg_decode_sof() to pass a stale raw_image_buffer pointer to hwaccel decoders like NVDEC, crashing applications or leaking heap contents.
An attacker can exploit this with local access to the system, without logging in, but a user has to do something, such as open a file or a link. Specific conditions have to be met, which makes an attack harder. If it succeeds: low risk of data being read, high risk of outages.
Affected products · FFmpeg
| Product | Affected versions |
|---|---|
| FFmpeg | through 9.0.2 Version 0 ≤9.0.2 |
Weakness classification
References
- NVD record
- CVE.org record
- GitHub advisory
- https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25231
- https://github.com/FFmpeg/FFmpeg/commit/f58a6776546567367baf5223df9ffbfd289299f8
- https://github.com/FFmpeg/FFmpeg/blob/n9.0.2/libavcodec/mjpegdec.c#L831
- https://github.com/FFmpeg/FFmpeg
- https://www.vulncheck.com/advisories/ffmpeg-through-9.0.2-use-after-free-in-mjpeg-hardware-accelerated-decoding
- https://github.com/advisories/GHSA-phr3-qwpx-974c
- https://nvd.nist.gov/vuln/detail/CVE-2026-125255