CVE-2026-134165 in probe-image-size
Summary
by MITRE • 11/21/2026
probe-image-size before 7.5.0 contains an unbounded memory allocation vulnerability in lib/parse_stream/avif.js that allows remote attackers to exhaust memory via attacker-declared ftyp or meta box sizes. Attackers can supply an AVIF stream or URL to probe(url) or probe(stream) declaring a huge box length, forcing the parser to buffer all received bytes and causing denial of service.
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 11/21/2026
The vulnerability identified in versions of probe-image-size prior to 7.5.0 represents a critical unbounded memory allocation flaw within the library's AVIF parsing logic, specifically located in the lib/parse_stream/avif.js module. This security defect arises from an insufficient validation mechanism when processing container metadata boxes, particularly the ftyp and meta boxes which define file type and media information respectively. In standard image format specifications such as AV1 Image File Format (AVIF), these box structures contain length fields that indicate the size of subsequent data payloads. The flaw manifests because the parser does not enforce reasonable upper bounds on these declared sizes before initiating memory allocation routines. Consequently, if an attacker supplies a maliciously crafted AVIF stream or URL to either the probe(url) or probe(stream) functions, they can manipulate these metadata fields to declare an excessively large box length that far exceeds available system resources.
From a technical perspective, this vulnerability exploits the synchronous nature of many Node.js parsing operations where memory buffers are allocated based on header information without prior size verification. When the parser encounters the attacker-declared huge box length, it attempts to allocate a buffer sufficient to hold all incoming bytes associated with that specific box structure. Since there is no cap on the allocation size relative to system limits or expected image dimensions, the process rapidly consumes available heap memory. This behavior transforms what should be a lightweight file type detection utility into a resource-intensive operation that can quickly overwhelm the host environment. The lack of input sanitization for structural metadata allows remote attackers to trigger this condition simply by providing a maliciously formatted AVIF file via HTTP request or direct stream injection, bypassing any need for authentication if the service is publicly accessible.
The operational impact of this vulnerability is severe, primarily resulting in denial of service conditions through resource exhaustion. As the application attempts to buffer the massive amount of data implied by the fraudulent box sizes, memory usage spikes dramatically, potentially leading to out-of-memory errors that crash the Node.js process or degrade performance for other concurrent operations sharing the same environment. In cloud-native or containerized deployments, this could trigger automatic restarts due to resource limits being exceeded, causing service interruptions and potential data loss if state is not persisted externally. Furthermore, in environments where such probing functions are used as part of larger media processing pipelines, a single malicious request can destabilize the entire application stack, affecting availability for legitimate users. This aligns with common attack patterns involving memory exhaustion attacks that target inefficient resource management practices in web services and API endpoints.
To mitigate this risk, organizations must immediately upgrade to version 7.5.0 or later of probe-image-size, where developers have implemented proper bounds checking on box sizes before allocation occurs. For systems unable to update immediately due to dependency constraints, implementing a reverse proxy or middleware layer that inspects incoming AVIF files for anomalous metadata headers can provide temporary protection by rejecting requests with excessively large declared box lengths. Additionally, applying resource limits at the container or process level using tools like cgroups in Linux environments can help contain the blast radius of such attacks by preventing any single process from consuming all available memory. It is also advisable to review other image processing libraries for similar vulnerabilities and ensure that input validation strategies are consistently applied across all media parsing components within the application architecture. This incident underscores the importance of validating structural metadata against expected maximums rather than trusting declared sizes implicitly, a principle central to secure coding standards such as CWE-789 which addresses uncontrolled memory allocation.