CVE-2026-66040
High · 8.8CVSS
8.8
EPSS
0.8%
Published
Jul 24, 2026
CISA due date
—
Cloudanix analysis
A flaw in a widely used video and image tool can let attackers crash programs or potentially take control by feeding it a specially made image file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Remote Code Execution
- Component
- Library
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap out-of-bounds write in native PNG and APNG encoders triggered when canonical serialization of an eXIf chunk with duplicate IFD references expands output beyond the allocation sized by add_exif_profile_size, allowing png_write_chunk to write past the buffer boundary.
Why it matters to the business
Media processing pipelines using FFmpeg may experience crashes or remote code execution when ingesting crafted images, risking service disruption and potential compromise of systems that handle user-supplied PNG or APNG content.
How an attack unfolds
An attacker crafts a PNG image containing an eXIf chunk with multiple IFD entries pointing to the same oversized payload, supplies the image to an affected FFmpeg encoder, and triggers deterministic heap corruption during chunk writing that can lead to process crash or arbitrary code execution.
How to fix it
Upgrade FFmpeg to a build containing commit b506faf or later; rebuild any dependent applications against the patched library and verify the fix is present in all encoder paths.
How to confirm the fix worked
Confirm installed FFmpeg version includes commit b506faf, run encoder against known-good test images, and attempt reproduction with a crafted eXIf PNG to verify absence of crash or corruption.
Typical attack path
- Craft PNG with malicious eXIf chunk containing duplicate IFD references to oversized payload
- Deliver image to FFmpeg PNG or APNG encoder via file, stream, or application input
- Trigger serialization path that underestimates required buffer size
- Execute out-of-bounds write in png_write_chunk resulting in heap corruption
How to detect it
Review FFmpeg process logs and crash dumps for segmentation faults or heap corruption during PNG encoding operations; correlate with inbound PNG files containing eXIf chunks.
- ffmpeg process crash with heap corruption during png_write_chunk
- eXIf chunk containing duplicate IFD entries in processed PNG files
What your security team should do
- Prioritize upgrade of all FFmpeg installations to post-b506faf builds
- Inventory applications and services that invoke FFmpeg PNG/APNG encoding
- Implement input sanitization or sandboxing for untrusted image processing until patched
- Monitor for FFmpeg process crashes correlated with PNG ingestion
The record
FFmpeg through 8.1.2, fixed in commit b506faf, contains a heap out-of-bounds write vulnerability in the native PNG and APNG encoders that allows remote attackers to corrupt heap memory by supplying a crafted PNG image with a malicious eXIf chunk. Attackers can craft an eXIf chunk where multiple IFD entries reference the same large value payload, causing canonical serialization to expand the output far beyond the undersized allocation estimated by add_exif_profile_size(), resulting in png_write_chunk() writing tens of thousands of bytes past the buffer boundary, leading to deterministic heap corruption, process crash, and potentially arbitrary code execution.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-120775 Tanium addressed a heap-based buffer overflow vulnerability in Deploy. CWE-122
- CVE-2026-121517 A vulnerability was detected in IrfanView 4.76.0.0 on Win64. CWE-122
- CVE-2026-121247 Buffer overflow in Dawn in Google Chrome on on Android prior to 157.0.8103.38 allowed a… CWE-122
- CVE-2026-121180 Buffer overflow in Media in Google Chrome prior to 157.0.8103.38 allowed a remote… CWE-122
- CVE-2026-121156 Buffer overflow in Dawn in Google Chrome prior to 157.0.8103.38 allowed a remote attacker… CWE-122
- CVE-2026-121113 Buffer overflow in PDFium in Google Chrome prior to 157.0.8103.38 allowed a remote… CWE-122
- CVE-2026-121086 Buffer overflow in Skia in Google Chrome prior to 157.0.8103.38 allowed a remote attacker… CWE-122
- CVE-2026-121047 Buffer overflow in Media in Google Chrome prior to 157.0.8103.38 allowed a remote… CWE-122