CVE-2026-12479: Keras 3.14.0 Path Traversal in Model Serialization
A flaw in Keras 3.14.0's model saving and loading functionality allows an attacker to use specially crafted layer names to write files or create directories outside the intended temporary working directory. While the code blocks forward slashes in layer names, it doesn't sanitize directory traversal sequences like `..`, enabling path escape. An attacker must trick a user into saving or loading a malicious model file for exploitation to occur.
Source data · NVD / CISA · public domain
- CVSS
- 3.0 · 6.1 MEDIUM · CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
- Weaknesses (CWE)
- CWE-22
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-06-22 / 2026-06-22
NVD description (verbatim)
A path traversal vulnerability exists in keras-team/keras version 3.14.0, specifically in the `DiskIOStore.make` method within the Keras 3 model saving and loading library. This vulnerability arises from the improper handling of user-provided layer names, which are used to construct directory paths without sanitizing for parent directory components (`..`). While forward slashes (`/`) are restricted in layer names, directory traversal sequences are not. This allows an attacker to craft a malicious Keras model that, when saved or loaded, can escape the intended temporary working directory and perform unauthorized file system operations, such as creating directories or writing files in arbitrary locations.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
CVE-2026-12479 is a path traversal vulnerability in the `DiskIOStore.make` method of Keras 3.14.0. The vulnerability stems from insufficient sanitization of user-supplied layer names used in file system path construction. Although forward slash characters are filtered, parent directory traversal sequences (`..`) are not stripped before paths are created. This allows an attacker to craft a model with malicious layer names that escape the temporary working directory sandbox during model serialization or deserialization, potentially writing arbitrary files or creating directories in unintended locations.
Business impact
Organizations using Keras 3.14.0 for machine learning workflows face file system integrity risks. An attacker could leverage this to inject malicious files into system locations, overwrite critical configuration files, or stage follow-on attacks. The attack requires user interaction—an employee must load or save a compromised model—making social engineering or supply chain compromise vectors relevant. For teams managing shared model repositories or accepting external models, this represents a potential integrity and confidentiality concern.
Affected systems
Keras 3.14.0 is confirmed affected. The vulnerability is specific to the `DiskIOStore.make` method in Keras 3's persistence layer. Users should verify whether other minor versions in the 3.x line contain the same code path. Earlier Keras 2.x versions and other machine learning frameworks are not affected by this specific flaw, though similar path traversal patterns should be audited across comparable serialization libraries.
Exploitability
Exploitability is moderate. An attacker must author a malicious Keras model with crafted layer names containing directory traversal sequences and convince a user to load or save it. No network interaction is required; the attack is local and synchronous with model I/O. The CVSS 3.0 score of 6.1 (MEDIUM, AV:L/AC:L/PR:N/UI:R) reflects these constraints: local access, low complexity, no privilege requirement, but required user interaction. This is not a remote code execution vector and does not grant elevated privileges by itself.
Remediation
Update Keras to a patched version that properly sanitizes layer names by removing or escaping parent directory traversal sequences. Patch details and version numbers should be verified against the official Keras security advisory and GitHub releases. In interim, restrict model loading to trusted sources, implement file system access controls to limit the blast radius of unauthorized writes, and audit model repositories for suspicious layer names containing `..` patterns.
Patch guidance
Check the Keras GitHub repository and official security advisories for the specific patched version. The fix should sanitize layer name input by either stripping traversal components or validating that constructed paths remain within the intended directory. After patching, verify your Keras version and test model save/load operations with existing pipelines. If internal model repositories exist, consider scanning stored models for suspicious layer name patterns as a precaution.
Detection guidance
Monitor file system access patterns during Keras model I/O operations, particularly unexpected writes outside the designated temporary working directory. Review Keras model files (inspect `.h5` or custom serialization formats) for layer names containing `..` sequences. Implement file integrity monitoring on critical system directories and configuration paths. Log all model loading and saving events with user context to identify potentially malicious activity.
Why prioritize this
Although scoring as MEDIUM severity, prioritize this based on your ML pipeline exposure: if your organization accepts external models, loads community-shared models, or runs collaborative ML workflows, this vulnerability should be addressed promptly. The barrier to exploitation is low (craft a model with traversal sequences), and the impact spans file system integrity. Conversely, teams that only work with internally developed, closely controlled models may defer patching with compensating controls in place.
Risk score, explained
The CVSS 3.0 score of 6.1 reflects a local attack vector, low attack complexity, and no privilege requirement, balanced against the requirement for user interaction. The vulnerability does not directly enable code execution or confidentiality breaches of stored data, but can compromise file system integrity and enable staging attacks. The score appropriately captures the practical risk for development and deployment environments where model handling is routine.
Frequently asked questions
Can this vulnerability be exploited remotely?
No. The attack requires local access and direct model I/O operations. An attacker must either place a malicious model file where a local user can access it or compromise a model repository that users pull from—both are not remote code execution.
What Keras versions are affected?
Keras 3.14.0 is confirmed affected. You should verify with the official Keras advisory whether other 3.x versions contain the vulnerable `DiskIOStore.make` code path. Keras 2.x users are not affected by this specific flaw.
What should we do if we've already loaded models from untrusted sources?
Review your file system for unexpected changes in critical directories during or shortly after model load operations. Audit the layer names in your stored models for `..` patterns. Restore from backups if unauthorized file creation or modification is detected, then patch Keras and implement stricter model source controls.
Does this allow an attacker to read sensitive files?
The primary impact is write/create operations in unintended locations. File read attacks via path traversal are theoretically possible depending on how paths are constructed, but the described vector focuses on unauthorized writes. Audit the patched code carefully to understand full exposure.
This analysis is based on the published CVE description and CVSS vector as of the date stated. Verify all patch versions, affected product lines, and remediation steps against official Keras security advisories and vendor documentation. No exploit code or weaponized proof-of-concepts are provided. This vulnerability requires user interaction and local access; it does not represent remote code execution. Organizations should conduct their own risk assessment based on their specific Keras deployment patterns and model sourcing practices. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2018-25393MEDIUMNavigate CMS 2.8.5 Path Traversal Vulnerability (CVSS 6.5)
- CVE-2018-25421MEDIUMOpen STA Manager 2.3 Path Traversal File Download Vulnerability
- CVE-2019-25734MEDIUMContact Form by WD CSRF & Local File Inclusion Vulnerability
- CVE-2019-25740MEDIUMJoomla com_jsjobs Arbitrary File Deletion Vulnerability
- CVE-2022-50953MEDIUMWordPress admin-word-count-column Plugin Local File Read Vulnerability
- CVE-2024-47263MEDIUMSynology Hyper Backup Path Traversal – Admin Privilege Required
- CVE-2024-47273MEDIUMSynology Hyper Backup Path Traversal Vulnerability (4.3 MEDIUM)
- CVE-2025-24268MEDIUMmacOS Path Traversal Vulnerability – Patch Sequoia 15.4