CVE-2026-12479: Keras Path Traversal Vulnerability
MODERATECVE-2026-12479 is a MODERATE (CVSS 6.1) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Keras libraries in the PyPI ecosystem. The issue involves diskiostore permits path traversal through crafted layer names. Remediation is available by upgrading affected packages to version 3.12.3, 3.15.0.
CVE-2026-12479 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L).
How to Fix CVE-2026-12479
To remediate this vulnerability, upgrade all affected Keras dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install keras>=3.12.3
pip install keras>=3.15.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show keras
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-12479, inspect your installed packages using pip:
pip show keras
Analyze the terminal output to locate any version of Keras in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.12.3), your application is affected.
Note: The pip show keras command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Keras, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-12479 Affected Keras Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
keras
|
PyPI |
< 3.12.3
|
3.12.3
|
|
keras
|
PyPI |
≥ 3.13.0
< 3.15.0
|
3.15.0
|
References
Frequently Asked Questions
What is CVE-2026-12479?
Which Keras versions are affected?
What version fixes CVE-2026-12479?
Is keras affected?
What is the CVSS score of CVE-2026-12479?
What CWE is associated with CVE-2026-12479?
How can I check PyPI dependencies for CVE-2026-12479?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gh82-f9x8-5frx",
"modified" : "2026-08-07T20:13:28Z",
"published" : "2026-06-22T18:34:13Z",
"aliases" : [ "CVE-2026-12479" ],
"summary" : "Keras: DiskIOStore permits path traversal through crafted layer names",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "keras"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.12.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "keras"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.13.0"
}, {
"fixed" : "3.15.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-12479"
}, {
"type" : "WEB",
"url" : "https://github.com/keras-team/keras/pull/23017"
}, {
"type" : "WEB",
"url" : "https://github.com/keras-team/keras/commit/d8caeb58cc9e61ea092445dc7a20908ca8d693e2"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/keras-team/keras"
}, {
"type" : "WEB",
"url" : "https://github.com/keras-team/keras/releases/tag/v3.12.3"
}, {
"type" : "WEB",
"url" : "https://github.com/keras-team/keras/releases/tag/v3.15.0"
}, {
"type" : "WEB",
"url" : "https://huntr.com/bounties/188836b9-12fc-49c7-8dbf-04f60fe33743"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-08-07T20:13:28Z",
"nvd_published_at" : "2026-06-22T16:16:33Z"
}
}