Keras Directory Traversal Vulnerability
CVE-2025-12060 · GHSA-hjqc-jx6g-rwp9 · published 2025-12-02
- Severity
- High
- CVSS score
- 9.8
- Chance of exploitation (EPSS)
- 0.63%
- Fixed in
- 3.12.0
- Exploitation No known exploitation
- Automatable No
- Technical impact Total
- CISA SSVC
Keras's keras.utils.getfile() function is vulnerable to directory traversal attacks despite implementing filtersafepaths(). The vulnerability exists because extractarchive() uses Python's tarfile.extractall() method without the security-critical filter="data" parameter. A PATH_MAX symlink resolution bug occurs before path filtering, allowing malicious tar archives to bypass security checks and write files outside the intended extraction directory.
Upgrade keras to 3.12.0 or later.
print(f"\n=== Building PATH_MAX Symlink Exploit ===")
Replace the vulnerable extraction code with:
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| keras | PyPI | <= 3.11.3 | 3.12.0 |
- 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.