CVE-2026-120755 in HDF5
Summary
by MITRE • 11/03/2026
HDF5 through 2.2.0 contains an out-of-bounds read vulnerability in H5Z__filter_szip() in src/H5Zszip.c. When decoding a szip-compressed chunk, the function subtracts the 4-byte uncompressed-length header from the chunk length without first verifying that the chunk is at least 4 bytes long. A truncated or corrupted chunk shorter than the header causes the length calculation to wrap around to a very large value, and the decompressor reads far past the end of the chunk buffer. An attacker who can get a user or application to read a dataset from a crafted HDF5 file can cause a denial of service. Only builds with szip support (libaec or the szip library) are affected.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 11/03/2026
The vulnerability identified in HDF5 versions up to 2.2.0 represents a critical out-of-bounds read flaw located within the H5Z__filter_szip function found in src/H5Zszip.c. This specific component is responsible for handling szip compression filters, which are commonly used to optimize storage efficiency for large datasets by compressing data chunks before they are written to disk or memory. The core technical deficiency lies in the input validation logic during the decoding process. When an application attempts to decompress a chunk of data that has been stored using the szip algorithm, the function retrieves metadata from the beginning of the chunk buffer. Specifically, it expects a four-byte header containing the uncompressed length of the data payload. The code proceeds immediately to subtract this expected uncompressed length from the total chunk size to determine bounds or offsets for reading operations. However, the implementation fails to perform an essential preliminary check to verify that the incoming chunk contains at least those initial four bytes required by the header structure.
This lack of boundary verification creates a severe integer underflow condition when processing malformed input. If an attacker provides a crafted HDF5 file containing a truncated or corrupted data chunk that is shorter than four bytes, the subtraction operation involving unsigned integers will wrap around to produce a very large positive value instead of failing gracefully with an error code. This erroneous calculation leads directly to an out-of-bounds read scenario where the decompressor attempts to access memory locations far beyond the actual end of the allocated buffer for the chunk. Such behavior is classified under CWE-125, which denotes Out-of-Bounds Read vulnerabilities, and aligns with ATT&CK technique T1499, Endpoint Denial of Service, as it allows an attacker to disrupt system availability through resource exhaustion or application crashes rather than gaining unauthorized access to data confidentiality at this stage.
The operational impact of this vulnerability is primarily centered on denial of service conditions for applications that rely on HDF5 libraries with szip support enabled, such as those linked against libaec or the proprietary szip library. When a user or automated process attempts to read a dataset from a maliciously crafted HDF5 file, the application may crash due to segmentation faults triggered by accessing invalid memory addresses. In more complex environments where these applications are part of larger data pipelines or scientific computing workflows, such crashes can lead to significant downtime and loss of productivity. Furthermore, depending on the specific implementation details of the surrounding code and the operating system's memory protection mechanisms, there may be secondary risks related to information disclosure if sensitive data residing in adjacent memory regions is inadvertently leaked through the out-of-bounds read operation, although the primary documented risk remains stability disruption.
Mitigation strategies for this vulnerability require both immediate patching and long-term defensive coding practices. The most effective remediation is to upgrade the HDF5 library to a version newer than 2.2.0 where this input validation flaw has been corrected by adding explicit checks to ensure chunk lengths meet minimum size requirements before parsing headers. For organizations unable to immediately update their dependencies, implementing strict file integrity verification and sandboxing mechanisms can help isolate potentially malicious files from critical processing environments. Additionally developers integrating HDF5 into new applications should enforce rigorous input sanitization at the application layer, ensuring that any external data sources are validated against expected schema constraints before being passed to low-level library functions. Regular security audits focusing on integer arithmetic operations in C/C++ codebases can also help identify similar patterns of unchecked subtraction that could lead to buffer overflows or underflows in other components.