CVE-2026-125250: FFmpeg through 9.0.2 GIF Encoder Heap Buffer Overflow via shrunk_buf Remap
FFmpeg through 9.0.2 contains a heap buffer overflow in the GIF encoder's gifimagewriteimage() in libavcodec/gif.c because shrunkbuf is sized from the first frame's linesize. Attackers can supply PAL8 video whose frame linesize grows mid-stream, causing remapframetopalette() to write past shrunkbuf and corrupt the heap during GIF transcoding.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
alpine/ffmpegto a version that resolves this vulnerability.Fixed in 8.1.4-r0 - Upgrade
Upgrade
debian/ffmpegto a version that resolves this vulnerability.Fixed in 7:7.1.6-0+deb13u1Fixed in 7:9.1-3 - Upgrade
Upgrade
debian/ffmpegto a version that resolves this vulnerability.Fixed in 7:7.1.6-0+deb13u1
Event History
Frequently Asked Questions
Which processing workflows are affected?
The issue is triggered during GIF transcoding in the GIF encoder. Workflows that encode attacker-supplied PAL8 video to GIF are exposed when a frame’s linesize increases after the first frame.
What must an attacker provide to trigger the overflow?
An attacker needs to supply PAL8 video with a frame linesize that grows mid-stream. The vulnerable remapping path then writes beyond the heap buffer allocated using the first frame’s linesize.
Does exploitation require prior privileges?
No prior privileges are required according to the supplied vector. Exploitation does require user interaction and local access.