Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft media with mid-stream resolution growth
-
ExploitSubmit to FFmpeg APNG transcoding pipeline
-
ExecutionTrigger oversized dispose-background memset past prev_frame
-
ImpactCorrupt heap or crash transcoder
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Heap buffer bounds checking
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the target application use FFmpeg's APNG encoder (libavcodec/pngenc.c encode_apng()) to encode output, and that it process an attacker-supplied input whose resolution increases mid-stream while the APNG_DISPOSE_OP_BACKGROUND dispose mode is in effect, causing the background memset to write past the prev_frame buffer. Limiting factors: the vector is local/file-based (AV:L) with high attack complexity and an explicit attack requirement (AC:H/AT:P), the victim application must actually ingest and transcode the crafted file (UI:P), and APNG output encoding is not a default for most media pipelines - so only services specifically configured to emit APNG are affected. No authentication is required (PR:N), but the non-default APNG encoding path substantially narrows the exposed population. |
| Impact | This is a genuine but conditional defect rather than a drop-everything emergency. The input CVSS 4.0 vector (AV:L/AC:H/AT:P/PR:N/UI:P, base 7.3) already tells against mass exploitation: the attack is local/file-based (AV:L), carries an explicit attack requirement (AT:P) and high complexity (AC:H), and needs the victim application to process the crafted input (UI:P). No EPSS score is supplied, there is no CISA KEV listing, and no PoC or exploit reference appears in the input, so there is no public exploit identified at time of analysis. The vuln.today decision label is 'this_week' - a moderate priority consistent with a patchable code-execution-class memory bug that is not yet weaponized. The description's mechanism (an APNG_DISPOSE_OP_BACKGROUND memset writing past prev_frame when resolution grows mid-stream) reads as a heap write of a fixed background value, so the clearly demonstrated impact is a crash or heap corruption (denial of service) in transcoding services; controlled arbitrary code execution is plausible for a CWE-122 heap overflow but is not established by the supplied evidence. Note a tension worth verifying: the input 4.0 vector rates VC/VI/VA all High, yet the described primitive is an uncontrolled memset overwrite, which more naturally supports a High availability impact than full confidentiality compromise - treat the confidentiality rating as unconfirmed. Real-world exposure is further gated by the target pipeline actually encoding to APNG, which is not a default for most FFmpeg deployments. |
| Exploit ScenarioDerived | An attacker submits a crafted media file whose resolution grows mid-stream to a service that transcodes output to APNG using FFmpeg (≤9.0.2); during encoding, the APNG_DISPOSE_OP_BACKGROUND memset writes past the prev_frame heap allocation, crashing the service or corrupting heap memory. The attack is local/file-based with high complexity and requires the application to process the input (AV:L/AC:H/UI:P). No public exploit is identified at time of analysis; only the upstream fix commit, pull request, and a VulnCheck advisory are referenced. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 09, 2026
Heap buffer overflow in FFmpeg's APNG encoder (encode_apng() in libavcodec/pngenc.c, through 9.0.2) allows crafted media whose frame resolution grows mid-stream to drive an APNG_DISPOSE_OP_BACKGROUND memset past the prev_frame buffer, corrupting heap memory or crashing the transcoding application. The issue is file/local in nature (AV:L, UI:P, high attack complexity with an explicit attack requirement) and only reachable by applications that actually encode APNG output, so services configured for ordinary video/audio transcoding are not on the affected path. No public exploit code or CISA KEV entry is associated with this CVE at time of analysis, though the upstream fix commit is public.
RemediationAI
Upstream fix available (PR/commit); released patched version not independently confirmed. The correcting change is commit 9b99973b2bbecee0b7e1e57035b95498b42f54a6 (see also PR https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25682), which tightens the send-frame dimension check in libavcodec/encode.c from a less-than comparison to an inequality so that any mid-stream resolution change, including growth, is rejected before the APNG encoder touches prev_frame. Downstream vendors embedding FFmpeg should track that commit or the first tagged release containing it and confirm their shipped libavcodec version against the vulnerable tag n9.0.2. Because no official patched release has been verified here, interim exposure control is to keep untrusted or externally supplied media away from APNG output encoding: pipelines that only decode, or that emit non-APNG formats, do not exercise encode_apng(), while pipelines that must produce APNG should normalize inputs to a fixed frame geometry before encoding. The trade-off of avoiding the APNG encoder is loss of animated-PNG output; the trade-off of pre-normalizing geometry is re-encoding overhead and possible quality loss. No vendor-specific configuration workaround is documented in the available sources.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
CWE-122 (heap-based buffer overflow) in FFmpeg's animated PNG muxing/encoding path. The APNG encoder keeps a snapshot of the previous frame (prev_frame) and, when a frame uses APNG_DISPOSE_OP_BACKGROUND, clears the region with a memset sized against the current frame geometry. If the incoming stream changes resolution mid-stream, the clearing write can extend beyond the allocated prev_frame buffer, producing a heap overflow (read as corruption or crash rather than controlled code execution). The referenced source anchor is libavcodec/pngenc.c at line 1148 in tag n9.0.2. The public upstream fix commit 9b99973b2bbecee0b7e1e57035b95498b42f54a6 addresses the root cause in libavcodec/encode.c: the internal send-frame check previously rejected only frames whose dimensions were smaller than the codec context (src->width < avctx->width || src->height < avctx->height) and now rejects any mismatch (src->width != avctx->width || src->height != avctx->height), so a mid-stream geometry change is refused before the encoder can operate on inconsistently sized buffers.
Know when Ffmpeg gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Local crafted-file processing (AV:L), gated by rare mid-stream resolution growth plus APNG dispose-background mode (AC:H), no auth (PR:N), app must process the file (UI:R); uncontrolled memset overflow chiefly crashes/corrupts heap, so A:H with limited C/I.
Primary rating from Vendor (vulncheck).
CVSS VectorVendor: vulncheck
DescriptionCVE.org
FFmpeg through 9.0.2 contains a heap buffer overflow vulnerability in the APNG encoder's encode_apng() function in libavcodec/pngenc.c when frame size changes mid-stream. Attackers can supply crafted media whose resolution grows mid-stream, causing APNG_DISPOSE_OP_BACKGROUND memset writes past prev_frame and crashing or corrupting heap memory in transcoding applications.
Executive ViewAI
CVE-2026-125218 is a high-severity heap overflow in FFmpeg's APNG encoder that affects only organizations actively encoding APNG output. Media processing services and content pipelines using APNG face potential memory corruption, crashes, or data integrity issues, but standard video/audio transcoding is not impacted.
No vendor-released patch identified at time of analysis; mitigate by disabling APNG encoding, restricting untrusted media inputs, or using an alternative encoder.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.
FFmpeg 2.x allows remote attackers to conduct cross-origin attacks and read arbitrary files by using the concat protocol
FFmpeg before 2.8.12, 3.0.x and 3.1.x before 3.1.9, 3.2.x before 3.2.6, and 3.3.x before 3.3.2 does not properly restric
FFmpeg 2.x allows remote attackers to conduct cross-origin attacks and read arbitrary files by using the subfile protoco
The av_reallocp_array function in libavutil/mem.c in FFmpeg before 2.0.1 has an unspecified impact and remote vectors re
cbs_jpeg_split_fragment in libavcodec/cbs_jpeg.c in FFmpeg 4.1 and 4.2.2 has a heap-based buffer overflow during JPEG_MA
Out-of-bounds heap write in FFmpeg's RASC video decoder (decode_dlta in libavcodec/rasc.c) allows attackers to corrupt m
Memory corruption in FFmpeg before 8.1 allows an attacker who can supply a crafted H.264/HEVC media file to corrupt heap
Memory exhaustion in FFmpeg git-master builds before commit d5873b can occur when a victim processes attacker-controlled
Integer Overflow vulnerability in function filter_sobel in libavfilter/vf_convolution.c in Ffmpeg 4.2.1, allows attacker
Integer Overflow vulnerability in function filter_robert in libavfilter/vf_convolution.c in Ffmpeg 4.2.1, allows attacke
Integer Overflow vulnerability in function filter_prewitt in libavfilter/vf_convolution.c in Ffmpeg 4.2.1, allows attack
Integer Overflow vulnerability in function filter16_sobel in libavfilter/vf_convolution.c in Ffmpeg 4.2.1, allows attack
EUVD-2026-120307
GHSA-hp56-qgqc-859j
NVD
CVE.org
EPSS
Exploit-DB