{"id":"CVE-2026-125218","kind":"vulnerability","aliases":["CVE-2026-125218"],"related":[],"title":"FFmpeg: crafted media with mid-stream resolution change overflows heap","description":"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.","summary":"FFmpeg's APNG encoder, in encode_apng() in libavcodec/pngenc.c, writes past a heap buffer when the frame size changes mid-stream. An attacker who supplies crafted media can crash transcoding applications or corrupt heap memory.","severity":"high","cvss":7.3,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"ffmpeg","fixed":[],"affected":"<= 9.0.2","ecosystem":"vendor"}],"ecosystems":[],"tags":["ffmpeg","media-transcoding","runtime","self-hosted"],"not_affected_if":["apng-not-used","no-untrusted-media"],"how_to_check":"- Run `ffmpeg -version`; 9.0.2 and earlier are affected per VulnCheck.\n- Find services that transcode user-supplied media and encode to APNG (-c:v apng or .apng output) with changing resolution mid-stream.\n- Check whether your build includes commit 9b99973b (git merge-base --is-ancestor 9b99973b <your-ref>).","fix":"Upstream commit 9b99973b2bbecee0b7e1e57035b95498b42f54a6 (avcodec/encode: reject video frames larger than the encoder too). No fixed release named yet; versions through 9.0.2 are affected. Build from a source that includes the commit, or check the FFmpeg release notes for a release after 9.0.2.","status":"open","published_at":"2026-11-09T19:16:59+00:00","first_seen_at":"2026-11-09T19:28:19+00:00","triaged_at":"2026-11-09T19:30:00+00:00","updated_at":"2026-11-09T19:33:52+00:00","category":"runtime","confidence":0.6,"triage":{"at":"2026-11-09T19:30:00Z","model":"claude-haiku-5-5","output":{"fix":"unknown","reach":"internet","title":"FFmpeg: crafted media with mid-stream resolution change overflows heap","impact":"medium","summary":"FFmpeg's APNG encoder, in encode_apng() in libavcodec/pngenc.c, writes past a heap buffer when the frame size changes mid-stream. An attacker who supplies crafted media can crash transcoding applications or corrupt heap memory.","audience":"businesses","category":"runtime","nicknames":[],"who_cares":["ffmpeg","media-transcoding","self-hosted"],"confidence":0.6,"fix_status":"unknown","needs_auth":"no","worst_case":"Crafted media crashes transcoder or corrupts heap memory","analyst_note":"Find the fixed FFmpeg version and the upstream commit from the linked Patch page (github.com) and confirm whether the flaw is only reachable with APNG output.","how_to_check":"- Check the installed FFmpeg version with `ffmpeg -version`; the sources say the flaw is present through `9.0.2`.\n- Find services that transcode user-supplied media with FFmpeg and whether they use APNG output.","plain_action":"","product_name":"","needs_analyst":true,"not_affected_if":["no-untrusted-media","apng-not-used"],"who_is_affected":"Applications that run FFmpeg to transcode media supplied by users or other untrusted sources are exposed, mainly when they encode APNG output. Systems that only process trusted local media, or that do not use FFmpeg's APNG encoder, are less exposed. The sources do not say which FFmpeg version contains the fix.","user_interaction":"unknown","product_ecosystem":"","needs_special_setup":"yes","severity_if_unknown":"unknown"},"cost_usd":0.00077,"input_tokens":4646,"output_tokens":611,"severity_before":"high"},"analyst_status":"done","analyst_note":"Find the fixed FFmpeg version and the upstream commit from the linked Patch page (github.com) and confirm whether the flaw is only reachable with APNG output.","search":"'-125218':14A,17A '-2026':13A,16A '9.0.2':65C 'apng':29B,33B,74C,78C,101C 'applic':58B,118C 'attack':50B,89C 'background':104C 'buffer':40B,69C 'caus':100C 'chang':9A,45B,85C 'contain':66C 'corrupt':60B,113C 'craft':2A,53B,92C 'crash':56B,111C 'cve':12A,15A 'dispos':102C 'encod':30B,32B,75C,77C 'ffmpeg':1A,18A,19B,27B,63C 'frame':43B,83C,109C 'function':79C 'grow':96C 'heap':11A,39B,61B,68C,114C 'host':26B 'libavcodec/pngenc.c':35B,81C 'media':3A,21B,54B,93C 'media-transcod':20B 'memori':62B,115C 'memset':105C 'mid':6A,47B,87C,98C 'mid-stream':5A,46B,86C,97C 'op':103C 'overflow':10A,70C 'past':37B,107C 'prev':108C 'resolut':8A,95C 'runtim':23B 'self':25B 'self-host':24B 'size':44B,84C 'stream':7A,48B,88C,99C 'suppli':52B,91C 'transcod':22B,57B,117C 'vulner':71C 'whose':94C 'write':36B,106C","nicknames":[],"mitigations":[],"who_affected":"Applications that run FFmpeg to transcode media supplied by users or other untrusted sources are exposed, mainly when they encode APNG output. Systems that only process trusted local media, or that do not use FFmpeg's APNG encoder, are less exposed. The sources do not say which FFmpeg version contains the fix.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"none","audience":"businesses","plain_action":null,"pkeys":["ffmpeg"],"ptokens":["ffmpeg"],"labels":["ffmpeg","high","mediatranscoding","runtime","selfhosted"],"campaign_type":null,"search_a":"'-125218':14A,17A '-2026':13A,16A 'chang':9A 'craft':2A 'cve':12A,15A 'ffmpeg':1A,18A 'heap':11A 'media':3A 'mid':6A 'mid-stream':5A 'overflow':10A 'resolut':8A 'stream':7A","search_b":"'apng':29B,33B 'applic':58B 'attack':50B 'buffer':40B 'chang':45B 'corrupt':60B 'craft':53B 'crash':56B 'encod':30B,32B 'ffmpeg':19B,27B 'frame':43B 'heap':39B,61B 'host':26B 'libavcodec/pngenc.c':35B 'media':21B,54B 'media-transcod':20B 'memori':62B 'mid':47B 'mid-stream':46B 'past':37B 'runtim':23B 'self':25B 'self-host':24B 'size':44B 'stream':48B 'suppli':52B 'transcod':22B,57B 'write':36B","search_c":"'9.0.2':65C 'apng':74C,78C,101C 'applic':118C 'attack':89C 'background':104C 'buffer':69C 'caus':100C 'chang':85C 'contain':66C 'corrupt':113C 'craft':92C 'crash':111C 'dispos':102C 'encod':75C,77C 'ffmpeg':63C 'frame':83C,109C 'function':79C 'grow':96C 'heap':68C,114C 'libavcodec/pngenc.c':81C 'media':93C 'memori':115C 'memset':105C 'mid':87C,98C 'mid-stream':86C,97C 'op':103C 'overflow':70C 'past':107C 'prev':108C 'resolut':95C 'size':84C 'stream':88C,99C 'suppli':91C 'transcod':117C 'vulner':71C 'whose':94C 'write':106C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-11-09T19:16:59+00:00","kev":null,"cvss_vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cvss_by":"disclosure@vulncheck.com","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-125218","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-125218","severity":null,"published_at":"2026-11-09T19:16:59+00:00","modified_at":"2026-11-09T19:16:59+00:00","first_seen_at":"2026-11-09T19:28:19+00:00","fetched_at":"2026-11-09T19:28:19+00:00","note":null},{"source":"analyst","external_id":"CVE-2026-125218:2327","url":null,"severity":null,"published_at":"2026-11-09T19:33:52+00:00","modified_at":"2026-11-09T19:33:52+00:00","first_seen_at":"2026-11-09T19:33:52+00:00","fetched_at":"2026-11-09T19:33:52+00:00","note":"Upstream commit 9b99973b (michaelni) fixes in libavcodec/encode.c (generic check: reject any frame whose size differs from encoder context), not pngenc.c, so the guard is not APNG-specific. No release containing it was named in the sources I could read (web-cli out of credits; commit page via WebFetch). Fixed release unknown; nothing verified."}],"documents":[{"id":109298,"url":"https://github.com/FFmpeg/FFmpeg/commit/9b99973b2bbecee0b7e1e57035b95498b42f54a6","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":109328,"url":"https://www.vulncheck.com/advisories/ffmpeg-through-9.0.2-apng-encoder-heap-buffer-overflow-via-encode-apng","title":"Third-party advisory: www.vulncheck.com","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: www.vulncheck.com"}],"disclosures":[],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}