Cloudanix VulnDB

CVE-2026-66040

High · 8.8

CVSS

8.8

EPSS

0.8%

Published

Jul 24, 2026

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

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

  1. Craft PNG with malicious eXIf chunk containing duplicate IFD references to oversized payload
  2. Deliver image to FFmpeg PNG or APNG encoder via file, stream, or application input
  3. Trigger serialization path that underestimates required buffer size
  4. 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