Description
A vulnerability in keras-team/keras versions <= 3.14.0 allows arbitrary local HDF5 file content disclosure due to improper handling of HDF5 ExternalLinks. The `KerasFileEditor` and `keras.saving.load_weights` functions bypass the `safe_get_h5_group` and `safe_get_h5_dataset` helpers, which are designed to reject ExternalLinks and SoftLinks. This results in automatic dereferencing of links to external HDF5 files, enabling attackers to disclose sensitive data from the victim's local filesystem. Specifically, `KerasFileEditor` extracts attributes and datasets from linked files into its internal structures, while `keras.saving.load_weights` loads weights from linked files into the user's model. This issue can be exploited by providing a malicious `.h5`, `.weights.h5`, or `.keras` file containing ExternalLinks.
Published: 2026-08-02
Score: 6.5 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability resides in Keras team releases through version 3.14.0, where the KerasFileEditor and keras.saving.load_weights functions bypass safety checks that are meant to reject HDF5 ExternalLinks and SoftLinks. This improper handling leads to automatic dereferencing of links to external HDF5 files, which means that a maliciously crafted .h5, .weights.h5, or .keras file can expose any local files that the process can read. The primary impact is disclosure of sensitive data from the victim's local filesystem rather than remote code execution or denial of service.

Affected Systems

Keras versions 3.14.0 and earlier, across any operating system that employs the KerasFileEditor or load_weights routines to load user‑supplied HDF5 model or weight files.

Risk and Exploitability

The CVSS score of 6.5 indicates a moderate severity vulnerability. The EPSS score is listed as less than 1%, suggesting an extremely low likelihood of exploitation in the wild. It is not presently catalogued in the CISA KEV. Attackers would need the ability to supply a malicious HDF5 file to the Keras application, either via a file upload or by directing the program to load a specific file path. Once present, the vulnerability allows local disclosure of any files that the executing user has access to, but does not provide a remote code execution path.

Generated by OpenCVE AI on August 3, 2026 at 09:29 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Keras to version 3.15 or newer to eliminate the vulnerable code paths.
  • Modify any custom loading logic to use the safe_get_h5_group and safe_get_h5_dataset helpers or otherwise reject HDF5 ExternalLinks before extraction.
  • Implement strict validation of any HDF5 files received from external sources, ensuring they contain no ExternalLinks and are accessed only with the minimal file system permissions required for the Keras process.

Generated by OpenCVE AI on August 3, 2026 at 09:29 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-m8wh-29wm-52mv Keras: HDF5 links can disclose local file contents
History

Mon, 03 Aug 2026 17:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Sun, 02 Aug 2026 21:00:00 +0000

Type Values Removed Values Added
First Time appeared Keras-team
Keras-team keras
Vendors & Products Keras-team
Keras-team keras

Sun, 02 Aug 2026 05:00:00 +0000

Type Values Removed Values Added
Description A vulnerability in keras-team/keras versions <= 3.14.0 allows arbitrary local HDF5 file content disclosure due to improper handling of HDF5 ExternalLinks. The `KerasFileEditor` and `keras.saving.load_weights` functions bypass the `safe_get_h5_group` and `safe_get_h5_dataset` helpers, which are designed to reject ExternalLinks and SoftLinks. This results in automatic dereferencing of links to external HDF5 files, enabling attackers to disclose sensitive data from the victim's local filesystem. Specifically, `KerasFileEditor` extracts attributes and datasets from linked files into its internal structures, while `keras.saving.load_weights` loads weights from linked files into the user's model. This issue can be exploited by providing a malicious `.h5`, `.weights.h5`, or `.keras` file containing ExternalLinks.
Title Improper Handling of HDF5 ExternalLinks in keras-team/keras
Weaknesses CWE-22
References
Metrics cvssV3_0

{'score': 6.5, 'vector': 'CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N'}


Subscriptions

Keras-team Keras
cve-icon MITRE

Status: PUBLISHED

Assigner: @huntr_ai

Published:

Updated: 2026-08-03T16:48:20.064Z

Reserved: 2026-05-22T23:38:39.544Z

Link: CVE-2026-9335

cve-icon Vulnrichment

Updated: 2026-08-03T16:48:14.631Z

cve-icon NVD

Status : Received

Published: 2026-08-02T05:16:20.827

Modified: 2026-08-03T17:16:46.397

Link: CVE-2026-9335

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T09:30:17Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')