Executive brief
FFmpeg, a widely used multimedia framework for processing video and images, contains a vulnerability in how it handles certain image metadata. By providing a specially crafted PNG or APNG image, an attacker could cause the software to crash or potentially execute unauthorized commands. This could lead to service disruptions or the theft of sensitive data in applications that use FFmpeg to process user-uploaded images.
Technical details
A heap-based buffer overflow (CWE-122) exists in the FFmpeg native PNG and APNG encoders. The vulnerability is rooted in the `add_exif_profile_size()` function, which underestimates the required buffer size for eXIf metadata. An attacker can craft a PNG with an eXIf chunk where multiple Image File Directory (IFD) entries reference the same large payload. During canonical serialization, these references are expanded, causing `png_write_chunk()` to write significantly past the allocated buffer. This results in deterministic heap corruption. The issue is fixed in commit b506faf by parsing the IFD to calculate the actual required size before allocation.
Affected products
- FFmpeg FFmpeg through 8.1.2
Timeline
- 2026-07-12: patched: Fix committed to FFmpeg master branch
- 2026-07-24: disclosed: CVE-2026-66040 published