UTC
High

Keras has a Local File Disclosure via HDF5 External Storage During Keras Weight Loading

CVE-2026-1669 · GHSA-3m4q-jmj6-r34q · published 2026-02-18

Severity
High
CVSS score
7.1
Chance of exploitation (EPSS)
0.33%
Fixed in
3.13.2
  • Exploitation No known exploitation
  • Automatable No
  • Technical impact Partial
  • CISA SSVC
What it is

Class: CWE-200 (Exposure of Sensitive Information), CWE-73 (External Control of File Name or Path) What leaks: Contents of any readable file on the host (e.g., /etc/hosts, /etc/passwd, /etc/hostname). Visibility: Secrets appear in model outputs (e.g., Dense layer bias) or get embedded into newly saved artifacts. Prerequisites: Victim executes model.load_weights() or tf.keras.models.load_model() on an attacker-supplied HDF5 weights file or .keras archive. Scope: Applies to modern Keras (3.x) and TensorFlow 2.x lines; legacy HDF5 paths remain susceptible.

What to do

Upgrade keras to 3.13.2 or later.

1. Default-deny external datasets/links: Inspect creation property lists (get_external_count) before materialising tensors. Resolve SoftLink / ExternalLink targets and block if they leave the HDF5 file. 2. Provide an escape hatch: Offer an explicit allow_external_data=True flag or environment variable for advanced users who truly rely on HDF5 external storage. 3. Documentation: Update security guidance and API docs to clarify that weight loading bypasses safe mode and that external HDF5 references are rejected by default. 4. Regression coverage: Add automated tests mirroring the scenarios above to ensure future refactors do not reintroduce the issue.

If you cannot upgrade yet

Avoid loading untrusted HDF5 weight files. Pre-scan weight files using h5py to detect external datasets or links before invoking Keras loaders. Prefer alternate formats (e.g., NumPy .npz) that lack external reference capabilities when exchanging weights. If isolation is unavoidable, run the load inside a sandboxed environment with limited filesystem access.

Affected
PackageRegistryAffectedFixed in
kerasPyPI>= 3.0.0, < 3.12.13.12.1
kerasPyPI>= 3.13.0, < 3.13.23.13.2

The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.

Sources: GitHub Advisory Database, reviewed and malware advisories (CC BY 4.0, https://github.com/advisories); advisories published by Cursor (https://github.com/cursor/cursor/security/advisories); advisories published by OpenClaw (https://github.com/openclaw/openclaw/security/advisories); advisories published by vLLM (https://github.com/vllm-project/vllm/security/advisories); advisories published by Open WebUI (https://github.com/open-webui/open-webui/security/advisories); advisories published by n8n (https://github.com/n8n-io/n8n/security/advisories); advisories published by Flowise (https://github.com/FlowiseAI/Flowise/security/advisories); advisories published by Langflow (https://github.com/langflow-ai/langflow/security/advisories); advisories published by the MCP Python SDK project (https://github.com/modelcontextprotocol/python-sdk/security/advisories); advisories published by MLflow (https://github.com/mlflow/mlflow/security/advisories); CISA Known Exploited Vulnerabilities catalog (CC0). Data as of 2026-11-22. ShieldMap describes how each problem works and how to fix it; it does not publish exploit code. Report a correction to [email protected].