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

CVE-2026-19027: HDF5 Information Disclosure Vulnerability

CVE-2026-19027 is an information disclosure flaw in HDF5 that allows attackers to trigger out-of-bounds heap reads through crafted files. This article covers technical details, affected versions, impact, and mitigation.

Published:

CVE-2026-19027 Overview

CVE-2026-19027 is an out-of-bounds heap read vulnerability in the HDF5 library through version 2.3.0. The flaw resides in the H5Z__nbit_decompress_one_byte, H5Z__nbit_decompress_one_nooptype, and H5Z__nbit_decompress_one_atomic functions inside H5Znbit.c. These routines advance a read index into the compressed chunk buffer without validating it against the buffer's actual size. Attackers can trigger the condition by supplying a crafted HDF5 file whose N-Bit filter parameters describe more decompressed data than the stored compressed chunk contains. Reading the dataset with H5Dread, including through tools such as h5ls or h5repack, exposes adjacent heap memory in decompressed dataset values.

Critical Impact

A crafted HDF5 file processed by h5ls, h5repack, or any application calling H5Dread can leak adjacent heap memory and crash the process.

Affected Products

  • HDF5 library through version 2.3.0
  • Applications linking libhdf5 and invoking H5Dread on N-Bit filtered datasets
  • HDF5 command-line utilities including h5ls and h5repack

Discovery Timeline

  • 2026-08-06 - CVE-2026-19027 published to NVD
  • 2026-08-06 - Last updated in NVD database

Technical Details for CVE-2026-19027

Vulnerability Analysis

HDF5 supports an N-Bit compression filter that packs dataset values into a compact bit stream. During decompression, H5Znbit.c walks the compressed buffer one element at a time, advancing an internal byte or bit index for each value it emits. The three affected functions handle atomic types, no-op types, and byte-aligned reads respectively. Each function increments the read index without checking whether the next read remains inside the compressed chunk buffer allocated by the library. When the filter's declared output size exceeds the actual stored chunk length, the decompression loop continues past the end of the buffer and copies adjacent heap contents into the returned dataset values [CWE-125].

Root Cause

The defect is a missing bounds check on the compressed input cursor. The N-Bit filter trusts parameters stored in the file to determine how many elements to produce, but it does not cross-check those parameters against the size of the compressed chunk buffer actually delivered to the decompressor. A malformed file can declare an inflated element count, causing the decoder to read past the end of the heap allocation.

Attack Vector

Exploitation requires a local user to open or inspect a malicious HDF5 file. The trigger path is H5Dread on a dataset that uses the N-Bit filter, which is reached automatically by common tools such as h5ls, h5repack, and any downstream application that ingests HDF5 data. The read returns attacker-influenced heap bytes inside the decompressed dataset values, which can then be extracted or logged by the caller. In addition to information disclosure, the out-of-bounds read can terminate the process when it strays into unmapped pages.

The vulnerability manifests during N-Bit filter decompression. See GitHub Issue #6489, GitHub Issue #6492, and GitHub Pull Request #6497 for the technical discussion and fix.

Detection Methods for CVE-2026-19027

Indicators of Compromise

  • HDF5 files whose N-Bit filter parameters advertise decompressed sizes larger than the stored compressed chunk length.
  • Crashes or ASan heap-buffer-overflow READ reports from h5ls, h5repack, or applications calling H5Dread.
  • Dataset values containing high-entropy bytes that do not match the declared numeric type or valid range.

Detection Strategies

  • Run HDF5 ingestion pipelines under AddressSanitizer or Valgrind to surface out-of-bounds reads in H5Znbit.c.
  • Validate incoming HDF5 files with a schema check that compares filter-declared element counts against physical chunk sizes.
  • Alert on unexpected termination of processes that parse HDF5 files from untrusted sources.

Monitoring Recommendations

  • Track invocations of h5ls, h5repack, and other HDF5 tools against files from external or user-uploaded locations.
  • Log crashes and abnormal exits of scientific-data workloads that link libhdf5.
  • Monitor file-integrity events on directories that hold shared HDF5 datasets.

How to Mitigate CVE-2026-19027

Immediate Actions Required

  • Upgrade HDF5 to a release that includes the fix from Pull Request #6497 once published by The HDF Group.
  • Restrict processing of HDF5 files to trusted sources until the patched library is deployed.
  • Rebuild and redistribute internal tools and containers that statically link libhdf5 after upgrading.

Patch Information

The HDF Group tracks the issue in GitHub Issue #6489 and GitHub Issue #6492, with the code fix proposed in Pull Request #6497. The change adds bounds checks on the read index used by H5Z__nbit_decompress_one_byte, H5Z__nbit_decompress_one_nooptype, and H5Z__nbit_decompress_one_atomic so decompression stops when the compressed buffer is exhausted.

Workarounds

  • Disable the N-Bit filter on data pipelines by re-encoding datasets without H5Z_FILTER_NBIT when producers are trusted.
  • Sandbox tools such as h5ls and h5repack with seccomp, firejail, or container isolation when opening untrusted files.
  • Pre-validate files with a lightweight parser that rejects N-Bit datasets whose declared element counts exceed the stored chunk size.
bash
# Configuration example: run HDF5 tooling inside an isolated container
docker run --rm --read-only --network=none \
  -v "$PWD/untrusted:/data:ro" \
  hdf5-tools:patched h5ls /data/input.h5

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.