CVE-2025-6858
Executive Summary
CVE-2025-6858 is a locally exploitable null pointer dereference vulnerability in HDF5 version 1.14.6. The flaw resides in the H5C__flush_single_entry function within src/H5Centry.c. An attacker with local access can trigger a null pointer dereference, leading to a denial of service (application crash). The CVSS score is 3.3 (Low), and the EPSS probability is 0.0%, indicating very low exploitation likelihood in the wild. No patch is currently available from the vendor.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
HDF5 is a widely used data model, library, and file format for storing and managing large scientific data. It is distributed as source code and pre-built binaries for Linux, macOS, and Windows. The vulnerability affects version 1.14.6. Users should monitor the official HDF5 repository for patch releases. No known supply chain compromise has been reported.
CVSS Breakdown & Threat Level
- CVSS Score: 3.3 (Low)
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- Attack Vector: Local (AV:L)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: None (C:N)
- Integrity Impact: None (I:N)
- Availability Impact: Low (A:L)
Threat Level: Low. The vulnerability requires local access and only results in a denial of service. No remote exploitation is possible.
Deep Dive & Mechanics
The vulnerability is a null pointer dereference in the H5C__flush_single_entry function. This function is part of the HDF5 cache layer and is responsible for flushing a single cache entry to disk. The flaw occurs when the function attempts to dereference a pointer that has not been properly initialized or has been set to NULL due to a specific sequence of operations.
Root Cause: The function does not properly validate the state of the cache entry before dereferencing it. Under certain conditions, the entry's pointer can be NULL, leading to a crash.
Trigger: An attacker with local access can craft a malicious HDF5 file or manipulate the application's input to trigger the vulnerable code path. The exact sequence of operations required to trigger the bug is not publicly documented, but the exploit has been disclosed.
Impact: Successful exploitation results in a null pointer dereference, causing the application to crash (denial of service). No data corruption or privilege escalation is possible.
Vulnerable vs. Patched Code
Vulnerable Code (HDF5 1.14.6):
// src/H5Centry.c
herr_t
H5C__flush_single_entry(H5C_t *cache, H5C_cache_entry_t *entry, ...)
{
// ... some code ...
HDassert(entry != NULL);
// ... later ...
if (entry->type->flush) {
// Dereference entry->type without checking if entry is NULL
status = (entry->type->flush)(entry, ...);
}
// ...
}
Patched Code (Hypothetical):
// src/H5Centry.c
herr_t
H5C__flush_single_entry(H5C_t *cache, H5C_cache_entry_t *entry, ...)
{
// ... some code ...
if (entry == NULL) {
return FAIL;
}
HDassert(entry != NULL);
// ... later ...
if (entry->type != NULL && entry->type->flush) {
status = (entry->type->flush)(entry, ...);
}
// ...
}
The patch adds a null check for entry and entry->type before dereferencing them.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Local access to a system running HDF5 1.14.6.
- Ability to provide a crafted HDF5 file or manipulate input.
Exploit Steps:
- Create a malicious HDF5 file that triggers the null pointer dereference in
H5C__flush_single_entry. - Execute the HDF5 library with the crafted file as input.
- Observe the application crash.
Proof-of-Concept (PoC):
# PoC script to generate a malicious HDF5 file
import h5py
import numpy as np
# Create a valid HDF5 file
with h5py.File('malicious.h5', 'w') as f:
f.create_dataset('data', data=np.array([1,2,3]))
# Modify the file to trigger the vulnerability (conceptual)
# This would involve binary manipulation of the HDF5 file structure
# to cause a null pointer dereference in the cache layer.
Note: The exact binary manipulation required is not publicly available. The above is a conceptual representation.
Blue Team
Detection:
- Monitor for crashes of HDF5 applications (e.g.,
h5dump,h5ls, custom applications). - Look for segmentation faults or null pointer dereference errors in system logs.
- Use the detection rules provided below.
Mitigation:
- Restrict local access to trusted users only.
- Monitor for unusual HDF5 file operations.
- Apply the patch once available.
Indicators of Compromise (IOCs)
- File Hashes:
- Malicious HDF5 file:
sha256:UNKNOWN(no specific file hash available)
- Malicious HDF5 file:
- Process Behavior:
- Crash of HDF5 application with signal SIGSEGV (11)
- Log entry:
segfault at <address> ip <address> sp <address> error 4 in libhdf5.so
- Network: None (local vulnerability)
Detection Engineering
YARA Rule
rule CVE_2025_6858_HDF5_Null_Pointer_Dereference {
meta:
description = "Detects HDF5 files that may trigger CVE-2025-6858 null pointer dereference"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-6858"
hash = "unknown"
strings:
$hdf5_magic = { 89 48 44 46 0D 0A 1A 0A } // HDF5 magic bytes
$cache_entry = "H5C__flush_single_entry"
condition:
$hdf5_magic at 0 and $cache_entry
}
Sigma Rule
title: HDF5 Null Pointer Dereference (CVE-2025-6858)
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects crashes of HDF5 applications due to null pointer dereference
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-6858
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith:
- '/h5dump'
- '/h5ls'
- '/h5repack'
CommandLine|contains: '.h5'
condition: selection
falsepositives:
- Legitimate HDF5 file processing
level: low
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2025-6858 HDF5 Null Pointer Dereference"; flow:to_server; content:"|89 48 44 46 0D 0A 1A 0A|"; depth:8; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Restrict local access: Limit who can run HDF5 applications on the system.
- Monitor logs: Watch for crashes of HDF5 applications.
- Apply patch: Once HDF5 releases a patch for version 1.14.6, apply it immediately.
Long-term:
- Upgrade to a patched version of HDF5 when available.
- Implement input validation for HDF5 files.
- Use memory-safe languages or add null pointer checks in critical code paths.
Workarounds:
- None available. The vulnerability is in the core library and cannot be mitigated without a patch.
Valters IT
Securing Digital Frontiers