CVE-2026-135707 in FFmpeg
Summary
by MITRE • 11/24/2026
FFmpeg before 9.1 contains an uninitialized memory vulnerability in nist_read_header() in libavformat/nistspheredec.c, where an inverted ff_alloc_extradata() return check leaves the embedded-shorten extradata byte uninitialized. Attackers can supply a crafted NIST SPHERE file declaring pcm,embedded-shorten coding to leak an uninitialized heap byte into copied output or trigger a NULL pointer write on allocation failure.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 11/24/2026
The vulnerability identified in FFmpeg versions prior to 9.1 resides within the libavformat/nistspheredec.c module, specifically affecting the nist_read_header function which is responsible for parsing NIST SPHERE audio files. This component handles various audio coding formats, including pcm and embedded-shorten. The core technical flaw stems from an incorrect logic check regarding memory allocation operations. Specifically, the code performs a call to ff_alloc_extradata but fails to correctly validate its return value due to an inverted conditional check. In standard C programming practices for FFmpeg, functions like ff_alloc_extradata are expected to return NULL on failure and a valid pointer upon success. However, in this specific instance, the logic was reversed or improperly implemented such that the subsequent code proceeds as if memory allocation succeeded even when it failed, or fails to properly initialize variables under certain conditions where allocation might succeed but leave data uninitialized depending on the exact control flow interpretation of inverted checks versus explicit NULL handling.
This logical error results in an uninitialized heap byte within the embedded-shorten extradata structure. When FFmpeg processes a crafted NIST SPHERE file that declares pcm or embedded-shorten coding, it attempts to read and process this header information. Because the memory allocation check is flawed, the system may proceed with operations using pointers or data structures that have not been properly initialized or allocated. This creates two distinct attack vectors for malicious actors. The first vector involves information disclosure through uninitialized memory leakage. If the code path proceeds despite a failed allocation or improper initialization state, sensitive data from previously freed heap chunks can be copied into the output stream. An attacker controlling the input file can exploit this to leak internal application memory contents, potentially exposing cryptographic keys, session tokens, or other private data residing in adjacent heap regions.
The second vector involves denial of service through a NULL pointer dereference. If ff_alloc_extradata returns NULL due to allocation failure and the inverted check allows execution to continue, subsequent code may attempt to write to this NULL pointer. This results in an immediate crash of the FFmpeg process or any application utilizing it for media processing. Such crashes can be triggered remotely by simply providing a maliciously crafted NIST SPHERE file, leading to service disruption without requiring authentication if the vulnerability is exposed via a web server or automated media scanning pipeline. The impact extends beyond simple instability; in complex applications that rely on FFmpeg for real-time audio processing, such memory corruption and crashes can lead to broader system compromise or significant operational downtime.
From a classification perspective, this issue aligns with CWE-908, which covers the use of uninitialized resource, specifically highlighting how improper initialization leads to unpredictable behavior. It also relates closely to CWE-252, unchecked return value, as the root cause is the failure to properly verify the success of critical memory allocation functions. In terms of offensive security frameworks like MITRE ATT&CK, this vulnerability facilitates Initial Access and potentially Privilege Escalation if combined with other exploits, while primarily enabling Information Discovery through heap spraying techniques that leverage uninitialized memory leaks. The attack pattern resembles common buffer over-read or information leak scenarios often seen in multimedia parsers where input validation is insufficient.
Mitigation strategies must prioritize immediate software updates to version 9.1 or later, where the logic error in nist_read_header has been corrected by properly validating the return value of ff_alloc_extradata and ensuring all extradata fields are explicitly initialized before use. For environments unable to update immediately, input validation at the network perimeter can help mitigate risk by filtering out malformed NIST SPHERE files or restricting support for embedded-shorten codecs if they are not strictly required. Additionally, enabling Address Sanitizer during development and testing phases helps detect such uninitialized memory accesses early in the software lifecycle. Security teams should also monitor logs for repeated crashes related to audio processing modules as an indicator of potential exploitation attempts targeting this specific flaw.