Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-17574

CVE-2026-17574: HDF5 NULL Pointer Dereference DOS Flaw

CVE-2026-17574 is a NULL pointer dereference denial-of-service vulnerability in HDF5 that triggers crashes when processing malicious files. This article covers the technical details, affected versions, impact, and mitigation.

Published:

CVE-2026-17574 Overview

CVE-2026-17574 is a NULL pointer dereference vulnerability [CWE-476] in the Hierarchical Data Format version 5 (HDF5) library. The flaw occurs when the library processes a crafted HDF5 file containing an attribute with an invalid variable-length (VL) datatype type field. Reading the malformed attribute causes the application to crash, resulting in a denial of service condition against any process linked to the vulnerable HDF5 library.

Critical Impact

Attackers can crash HDF5-linked applications by supplying a malformed file with an invalid variable-length datatype, disrupting scientific computing, data analysis, and machine learning pipelines that rely on HDF5.

Affected Products

  • HDF5 library maintained by The HDF Group
  • Applications and language bindings that link against affected HDF5 versions (libhdf5)
  • Scientific and data analysis tools that ingest untrusted HDF5 files

Discovery Timeline

  • 2026-07-27 - CVE-2026-17574 published to NVD
  • 2026-07-30 - Last updated in NVD database

Technical Details for CVE-2026-17574

Vulnerability Analysis

The vulnerability resides in the HDF5 datatype decoding logic in src/H5Odtype.c and the location-setting logic in src/H5T.c. When the library decodes a variable-length datatype from an on-disk object header, it reads the type field from the flags byte and assigns it directly to dt->shared->u.vlen.type without validating the value. HDF5 defines only two valid VL types: H5T_VLEN_SEQUENCE and H5T_VLEN_STRING. A crafted attribute containing any other value bypasses type-specific initialization.

Later, when H5T_set_loc runs for a disk-based VL type, it dereferences the file pointer to update location metadata. Because the earlier decode path failed to reject the invalid type and does not guarantee a valid file context, the pointer can be NULL at dereference time, triggering a crash.

Root Cause

The root cause is missing input validation on the VL datatype type field read from untrusted file content combined with an absent NULL check on the file pointer for disk-based VL types. Both conditions together allow attacker-controlled bytes to reach a dereference site without defensive checks.

Attack Vector

Exploitation requires local file access and user interaction: a victim must open or read a malicious HDF5 file with an application linked to the vulnerable library. The impact is limited to availability - the process crashes when the attribute is read. No code execution or data disclosure has been reported.

c
// Source: https://github.com/HDFGroup/hdf5/commit/3fa6ed6e9dfeebbc784e21d8c48e31e35a8042bc
// Patch in src/H5Odtype.c - validates VL datatype type during decode
             */
            /* Set the type of VL information, either sequence or string */
            dt->shared->u.vlen.type = (H5T_vlen_type_t)(flags & 0x0f);
+           if (dt->shared->u.vlen.type != H5T_VLEN_SEQUENCE && dt->shared->u.vlen.type != H5T_VLEN_STRING)
+               HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid VL datatype type");
            if (dt->shared->u.vlen.type == H5T_VLEN_STRING) {
                dt->shared->u.vlen.pad  = (H5T_str_t)((flags >> 4) & 0x0f);
                dt->shared->u.vlen.cset = (H5T_cset_t)((flags >> 8) & 0x0f);

The companion fix in src/H5T.c adds an explicit NULL check on the file pointer for disk-based VL datatypes:

c
// Source: https://github.com/HDFGroup/hdf5/commit/3fa6ed6e9dfeebbc784e21d8c48e31e35a8042bc
+               /* Validate file pointer for disk-based VL types */
+               if (loc == H5T_LOC_DISK && NULL == file)
+                   HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL,
+                               "NULL file pointer for disk-based VL datatype");

                /* Mark this VL sequence */
                if ((changed = H5T__vlen_set_loc(dt, file, loc)) < 0)
                    HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location");

Detection Methods for CVE-2026-17574

Indicators of Compromise

  • Repeated segmentation faults or crash dumps from processes linked to libhdf5 when opening user-supplied files
  • HDF5 files with attributes whose VL datatype type field is neither H5T_VLEN_SEQUENCE (0) nor H5T_VLEN_STRING (1)
  • Unexpected termination of data ingestion, HPC, or ML training jobs immediately after reading an attribute

Detection Strategies

  • Scan HDF5 files with h5dump or h5ls in a sandboxed environment before ingestion and treat scanning failures as suspicious
  • Enable core dump collection on scientific workstations and inspect stack traces for frames in H5T_set_loc or H5O__dtype_decode_helper
  • Compare installed libhdf5 versions across hosts to identify unpatched systems processing external files

Monitoring Recommendations

  • Alert on abnormal exit codes from HDF5-dependent tools such as h5py, PyTables, MATLAB, or NetCDF-based applications
  • Track file provenance for HDF5 inputs entering shared research environments and quarantine files from untrusted sources
  • Monitor for repeated crash-restart cycles of long-running analysis services that consume HDF5 data

How to Mitigate CVE-2026-17574

Immediate Actions Required

  • Update libhdf5 to a version that includes commit 3fa6ed6e9dfeebbc784e21d8c48e31e35a8042bc
  • Rebuild or re-link downstream applications and Python wheels that statically embed the HDF5 library
  • Restrict processing of HDF5 files to trusted sources until patched builds are deployed

Patch Information

The HDF Group addressed the issue in the upstream repository by validating the VL datatype type field during decode in src/H5Odtype.c and by adding a NULL check on the file pointer in src/H5T.c. See the GitHub HDF5 Commit Change for the full patch.

Workarounds

  • Run HDF5 parsing in isolated processes or containers so a crash does not disrupt the parent workflow
  • Validate HDF5 files with a schema check or trusted converter before passing them to production readers
  • Disable automated ingestion of externally supplied HDF5 files where feasible
bash
# Verify the installed HDF5 library version and rebuild dependents after patching
h5cc -showconfig | grep -i version
ldconfig -p | grep libhdf5
# Example: rebuild h5py against a patched libhdf5
pip install --no-binary=h5py --force-reinstall h5py

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.