# CVE-2026-9335: Keras HDF5 arbitrary file disclosure via ExternalLinks

Source: https://junglewise.ai/threats/cve-2026-9335-keras-hdf5-arbitrary-file-disclosure-via-externallinks  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-02. Updated: 2026-08-07  
License: CC BY 4.0 with a link back

CVE-2026-9335 · Severity: medium · CVSS 6.5 · Published 2026-08-02

A vulnerability in the Keras machine learning library allows for the unauthorized disclosure of local files. By providing a specially crafted model or weight file, an attacker can trick the software into reading other sensitive files on the victim's system, such as other users' model weights or cached data. This could lead to the theft of proprietary AI models or sensitive information stored on shared training clusters.

Technologies: [keras (PyPI)](https://junglewise.ai/threats/technologies/keras). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-9335 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-9335 being exploited in the wild.

**How severe is CVE-2026-9335?** Medium severity, with a CVSS score of 6.5, published 2 August 2026.

**Which products and versions are affected?** keras (PyPI) ECOSYSTEM:introduced=0,fixed=3.12.3, ECOSYSTEM:introduced=0,fixed=3.12.3,introduced=3.13.0,fixed=3.15.0.

**Is there a fix for CVE-2026-9335?** Yes. keras (PyPI): upgrade to 3.12.3, 3.15.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-9335 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-9335?** Check whether you run keras (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- keras (PyPI): upgrade to 3.12.3, 3.15.0 or later

  ```sh
  pip install "keras>=3.15.0"
  ```


## Technical details

A path traversal and information disclosure vulnerability exists in Keras due to the improper handling of HDF5 ExternalLinks and SoftLinks within the KerasFileEditor and keras.saving.load_weights functions. These components bypass security helpers (safe_get_h5_group and safe_get_h5_dataset) designed to block link dereferencing. An attacker can craft a malicious HDF5-based file containing links to sensitive files on the host filesystem. When a victim loads this file or uses the KerasFileEditor to inspect it, the library automatically follows these links, extracting the target file's contents into internal structures or model weights, which can then be exfiltrated. The issue is addressed in versions 3.12.3 and 3.15.0.

## Affected products

- keras-team Keras <= 3.14.0

## Identifiers

- CVE-2026-9335
- GHSA-m8wh-29wm-52mv
- PYSEC-2026-3633

## Timeline

- 2026-08-02: disclosed
- 2026-08-02: advisory
- 2026-05-20: patched: Initial PR merged for KerasFileEditor fix

## References

- [https://github.com/keras-team/keras/commit/23370f16b0ab9a200f7550a34e54a3ceab74ba0e](https://github.com/keras-team/keras/commit/23370f16b0ab9a200f7550a34e54a3ceab74ba0e)
- [https://huntr.com/bounties/876a7226-5428-4a66-9d05-232461120db5](https://huntr.com/bounties/876a7226-5428-4a66-9d05-232461120db5)
- [https://github.com/keras-team/keras/pull/22899](https://github.com/keras-team/keras/pull/22899)
- [https://github.com/keras-team/keras/pull/23165](https://github.com/keras-team/keras/pull/23165)
- [https://github.com/keras-team/keras/commit/d338a45204bdc787c8b3c4a9b82c1911cd52dedf](https://github.com/keras-team/keras/commit/d338a45204bdc787c8b3c4a9b82c1911cd52dedf)

## Related threats

- [Keras model loading denial of service via HDF5 shape bombs](https://junglewise.ai/threats/cve-2026-12570-keras-model-loading-denial-of-service-via-hdf5-shape-bombs)
- [Keras unsafe deserialization in TorchModuleWrapper](https://junglewise.ai/threats/cve-2026-12484-keras-unsafe-deserialization-in-torchmodulewrapper)
- [Keras path traversal via symlink in filter_safe_tarinfos](https://junglewise.ai/threats/cve-2026-12482-keras-path-traversal-via-symlink-in-filter-safe-tarinfos)
- [Keras Team Keras arbitrary code execution in Lambda layer](https://junglewise.ai/threats/cve-2026-12481-keras-team-keras-arbitrary-code-execution-in-lambda-layer)
- [Keras arbitrary HDF5 file read in model loading](https://junglewise.ai/threats/cve-2026-12480-keras-arbitrary-hdf5-file-read-in-model-loading)
