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
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.
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.
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.
- CriticalMCP Path Traversal Allows Full-Filesystem Read and JWT Secret Exfiltration Leading to Account Takeoverlangflow, langflow-base
- Critical@zereight/mcp-gitlab: Unauthenticated arbitrary file read via `upload_markdown` enables PAT exfiltration and full account takeover@zereight/mcp-gitlab
- CriticalFlowise RCE via SQL Database Chain Nodeflowise, flowise-components
- CriticalLangroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file callslangroid
- Criticalfast-mcp-telegram: Bearer token path traversal bypasses reserved Telegram session protectionfast-mcp-telegram
- CriticalMCP Toolbox HTTP tool path parameters allow traversal to unintended endpointsgithub.com/googleapis/mcp-toolbox
- CriticalKeras framework vulnerable to deserialization of untrusted datakeras
- CriticalKeras code injection vulnerabilitykeras
- HighKeras: TorchModuleWrapper can deserialize unsafe PyTorch pickle datakeras, keras
- HighKeras: Lambda deserialization can bypass safe mode and execute codekeras, keras
- HighKeras archive extraction utilities allow path traversal and arbitrary file writeskeras
- HighKeras vulnerable to DoS via Malicious .keras Model (HDF5 Shape Bomb Causes Petabyte Allocation in KerasFileEditor)keras, keras
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.