High severity8.8NVD Advisory· Published Jul 24, 2026· Updated Aug 7, 2026
CVE-2026-66040
CVE-2026-66040
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
7- osv-coords5 versionspkg:apk/chainguard/ffmpeg-6pkg:apk/chainguard/ffmpeg-7.1pkg:apk/chainguard/ffmpeg-8.0pkg:apk/wolfi/ffmpeg-7.1pkg:apk/wolfi/ffmpeg-8.0
< 0+ 4 more
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
Patches
Vulnerability mechanics
References
3- code.ffmpeg.org/FFmpeg/FFmpeg/commit/b506fafec9a19fcbc2be5271875fd4a63d6615bcnvdPatch
- code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23786nvdIssue TrackingPatch
- www.vulncheck.com/advisories/ffmpeg-heap-out-of-bounds-write-via-png-apng-exif-encodernvdThird Party Advisory
News mentions
2- Multiple FFmpeg Vulnerabilities Allow Attackers to Corrupt Memory Via Malicious Video FileCyber Security News · Jul 28, 2026
- FFmpeg: Four Memory Corruption Vulnerabilities Disclosed in BatchVypr Intelligence · Jul 25, 2026