CVE-2026-66040
Received Received - Intake

Heap Out-of-Bounds Write in FFmpeg PNG/APNG Encoders

Vulnerability report for CVE-2026-66040, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-24

Last updated on: 2026-07-24

Assigner: VulnCheck

Description

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-24
Last Modified
2026-07-24
Generated
2026-07-25
AI Q&A
2026-07-24
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
ffmpeg ffmpeg to 8.1.2 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-122 A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is a heap out-of-bounds write flaw in FFmpeg versions up to 8.1.2. It occurs when processing a crafted PNG image with a malicious eXIf chunk. Multiple IFD entries reference the same large value payload, causing the output to expand beyond the allocated buffer. This leads to heap corruption, crashes, and potential arbitrary code execution.

Detection Guidance

To detect this vulnerability, inspect network traffic for PNG or APNG images containing eXIf chunks. Use tools like Wireshark to filter for PNG files and analyze their metadata. On systems running FFmpeg, check the version with `ffmpeg -version` and compare it against 8.1.2 or earlier.

Impact Analysis

If exploited, this vulnerability could allow remote attackers to crash applications using affected FFmpeg versions or execute arbitrary code on your system. Simply opening a maliciously crafted PNG file could trigger the issue, potentially compromising your device or data.

Compliance Impact

This vulnerability could lead to unauthorized data access or modification, which may violate GDPR's integrity and confidentiality requirements under Articles 5 and 32, and HIPAA's Security Rule for integrity and availability of protected health information.

Mitigation Strategies

Immediately update FFmpeg to a version that includes commit b506faf or later. Avoid processing untrusted PNG or APNG files until patched. If updating is not possible, disable the PNG and APNG encoders in FFmpeg's configuration.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-66040. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart