FFmpeg MACE6 Decoder Flaw Enables Heap Out-of-Bounds Write via Crafted CAF Files
Vulnerability Disclosure · 4 sources · Updated 2d ago · First seen Jul 24, 2026

FFmpeg through version 8.1.2 is affected by CVE-2026-66039, a high-severity flaw in the MACE6 audio decoder that can be triggered with a crafted CAF file. The vulnerability stems from a signed integer overflow in mace_decode_frame() when attacker-controlled bytes_per_packet and frames_per_packet values are parsed from the file's desc chunk, causing the decoder to miscalculate output sample counts.
The overflow can lead to an undersized heap allocation followed by a heap out-of-bounds write, creating a path to memory corruption and possible code execution in contexts where a user opens or processes a malicious media file. The issue is mapped to CWE-190 and CWE-122, carries a CVSS v3.1 rating of AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H, and was fixed in FFmpeg commit aafb5c655edc76a753275c383ebb139feb032718, which rejects sample counts that overflow int.
Why it matters
Impact assessment
FFmpeg deployments that decode untrusted media are affected, including media processing backends, content moderation pipelines, desktop applications, browsers or players embedding FFmpeg, and any service that ingests CAF audio files. The flaw is high severity because a crafted file can cause heap corruption and potentially code execution when a user or automated workflow opens or processes the file.
Exposure is potentially broad because FFmpeg is widely embedded across products, but exploitation requires delivery of a malicious CAF file and user interaction or automated processing of that file. No confirmed in-the-wild exploitation is stated in the provided references.
Affected populations
- Organizations running FFmpeg through version 8.1.2
- Vendors and applications statically or dynamically linking vulnerable FFmpeg builds
- Media ingestion, transcoding, archival, and analysis systems that accept CAF inputs
- End users opening untrusted audio/media files in software built on FFmpeg
Severity and business impact
- Potential confidentiality, integrity, and availability impact is high per CVSS vector
- Likely outcomes include process crash, service disruption, and possible remote code execution in the decoding context
- Multi-tenant media processing environments face elevated risk if untrusted uploads are decoded automatically
- Reputational and operational impact is higher for SaaS platforms that process customer-supplied media at scale
Scope and exploitation status
- Scope is widespread at the software supply-chain level because FFmpeg is broadly reused
- Practical exploitation is targeted to workflows that parse CAF files and invoke the MACE6 decoder path
- No public incident reporting or exploitation-in-the-wild evidence is included in the references

