CVE-2026-66040: FFmpeg Heap Out-of-Bounds Write via PNG/APNG eXIf Encoder

Published Jul 24, 2026
·
Updated

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 addexifprofilesize(), resulting in pngwritechunk() writing tens of thousands of bytes past the buffer boundary, leading to deterministic heap corruption, process crash, and potentially arbitrary code execution.

Affected Software

1 affected component
FFmpeg FFmpeg<=8.1.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch b506faf
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 8.1.2

Event History

Jul 24, 2026
CVE Published
via MITRE·07:46 PM
Data Sourced
via MITRE·07:46 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:18 PM
DescriptionSeverityWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-66040?

CVE-2026-66040 has a high severity rating of 8.8.

2

How do I fix CVE-2026-66040?

To fix CVE-2026-66040, upgrade to FFmpeg version 8.1.2 or later.

3

What component of FFmpeg is affected by CVE-2026-66040?

CVE-2026-66040 affects the native PNG and APNG encoders in FFmpeg.

4

What type of attacks can CVE-2026-66040 enable?

CVE-2026-66040 allows remote attackers to corrupt heap memory via a crafted PNG image.

5

When was CVE-2026-66040 published?

CVE-2026-66040 was published on July 24, 2026.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203