CVE-2026-86095 Overview
CVE-2026-86095 is an out-of-bounds write vulnerability [CWE-787] in Unidata netcdf-c through version 4.10.1. The flaw resides in the NC4_HDF5_inq_attname() function, which copies Hierarchical Data Format version 5 (HDF5) attribute names into a fixed 256-byte buffer without validating the source length. Attackers can craft HDF5 files containing oversized attribute names to overflow the destination buffer. Successful exploitation causes memory corruption and application crashes when a target enumerates attribute names from the malicious file.
Critical Impact
A crafted HDF5 file can corrupt process memory and crash any application built on netcdf-c that enumerates attributes, with potential for further exploitation leading to arbitrary code execution.
Affected Products
- Unidata netcdf-c versions through 4.10.1
- Applications and libraries that link netcdf-c and call nc_inq_attname() on HDF5-backed files
- Scientific computing pipelines and data processing tools that ingest untrusted HDF5/NetCDF-4 data
Discovery Timeline
- 2026-09-04 - CVE-2026-86095 published to the National Vulnerability Database
- 2026-09-08 - Last updated in NVD database
Technical Details for CVE-2026-86095
Vulnerability Analysis
The vulnerability lives in NC4_HDF5_inq_attname() inside libhdf5/hdf5attr.c. The function reads an HDF5 attribute name from a file and copies it into a caller-supplied buffer that netcdf-c documents as being NC_MAX_NAME + 1 bytes, which equals 256 bytes. The routine does not verify that the underlying HDF5 name fits before performing the copy.
HDF5 itself does not impose the same 256-byte name limit that netcdf-c assumes. An attacker who controls the file contents can therefore place an attribute name that is longer than the destination buffer. When downstream code invokes nc_inq_attname() and passes a stack- or heap-allocated 256-byte buffer, the oversized name overwrites adjacent memory.
The consequences depend on the calling code's memory layout. Stack-allocated buffers expose saved return addresses and frame pointers; heap-allocated buffers expose adjacent chunk metadata and objects. Memory corruption produces crashes at minimum, with the possibility of arbitrary code execution in the process context that opened the file.
Root Cause
The root cause is a missing length check between two libraries with different naming constraints. netcdf-c enforces NC_MAX_NAME of 255 characters, while the underlying HDF5 API does not. The wrapper trusts the HDF5-reported name without truncation or bounds validation before copying it into the fixed buffer.
Attack Vector
Exploitation requires an attacker to deliver a malicious HDF5 or NetCDF-4 file and convince a victim to open it with a vulnerable netcdf-c build. This includes scientific data portals, automated ingestion pipelines, and desktop analysis tools such as those in the Python, R, and MATLAB ecosystems that bind to netcdf-c. User interaction is required to initiate file processing, but no authentication or network access to the target is needed.
No verified proof-of-concept code has been published. See the VulnCheck Advisory for NetCDF-C and the GitHub NetCDF-C HDF5 Attribute Code for technical details of the vulnerable function.
Detection Methods for CVE-2026-86095
Indicators of Compromise
- HDF5 or NetCDF-4 files containing attribute names longer than 255 bytes, which exceed the NC_MAX_NAME limit enforced by netcdf-c
- Unexpected crashes, SIGSEGV, or stack-smashing terminations in processes that call nc_inq_attname() or enumerate NetCDF attributes
- Core dumps referencing NC4_HDF5_inq_attname in the crashing call stack
Detection Strategies
- Inventory applications and containers that statically or dynamically link netcdf-c 4.10.1 or earlier, including Python netCDF4, xarray, and R ncdf4 deployments
- Pre-scan incoming HDF5 files with h5dump -A or h5ls -v and reject files whose attribute names exceed 255 bytes before handing them to netcdf-c
- Run untrusted file parsing under AddressSanitizer or a hardened allocator in test environments to surface out-of-bounds writes deterministically
Monitoring Recommendations
- Alert on repeated crashes of scientific data workers, batch converters, or web ingestion services that consume user-supplied NetCDF or HDF5 content
- Collect and centralize core dump metadata so that faults in libnetcdf and libhdf5 are visible to security operations
- Track file provenance and hash values for HDF5 datasets entering trusted analysis environments
How to Mitigate CVE-2026-86095
Immediate Actions Required
- Identify every system that ships or embeds netcdf-c 4.10.1 or earlier, including third-party scientific software distributions such as Conda and Spack environments
- Restrict ingestion of HDF5 and NetCDF-4 files to trusted sources until a patched build is deployed
- Move parsing of untrusted files into sandboxed or containerized workers with no access to sensitive data or credentials
Patch Information
At publication time, no fixed upstream release is referenced in the NVD entry. Monitor the GitHub NetCDF-C Repository for a release that adds bounds validation to NC4_HDF5_inq_attname() and update as soon as a patched version is available. Rebuild any downstream language bindings and container images against the fixed library.
Workarounds
- Wrap or filter untrusted HDF5 files with an HDF5-native tool that rejects attribute names longer than 255 bytes before invoking netcdf-c
- Compile netcdf-c and its consumers with stack protectors, _FORTIFY_SOURCE=2, and position-independent executables to reduce exploitability of the overflow
- Enforce least-privilege execution for data conversion services so a successful memory corruption does not yield elevated access
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

