CVE-2026-12482: Keras Path Traversal Vulnerability
LOWCVE-2026-12482 is a LOW (CVSS 3.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 tar extraction permits symlink-based path traversal. Remediation is available by upgrading affected packages to version 3.12.3, 3.15.0.
CVE-2026-12482 at a Glance
Security Impact
CVSS: 3.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N).
How to Fix CVE-2026-12482
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-12482, 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-12482 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-12482?
Which Keras versions are affected?
What version fixes CVE-2026-12482?
Is keras affected?
What is the CVSS score of CVE-2026-12482?
What CWE is associated with CVE-2026-12482?
How can I check PyPI dependencies for CVE-2026-12482?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-58hv-7753-xmfq",
"modified" : "2026-08-07T20:32:12Z",
"published" : "2026-07-14T06:31:23Z",
"aliases" : [ "CVE-2026-12482" ],
"summary" : "Keras: tar extraction permits symlink-based path traversal",
"details" : "A vulnerability in keras-team/keras version 3.12.0 allows an attacker to craft a malicious tar archive that bypasses the `filter_safe_tarinfos` validation in `keras/src/utils/file_utils.py`. Specifically, symlink entries are not subjected to the same `is_path_in_dir` validation as regular file entries, allowing symlinks to be created outside the intended extraction directory. This can lead to symlink-based file read, file overwrite, or directory escape attacks. The issue is particularly impactful on Python 3.10 and 3.11, where `filter_safe_tarinfos` is the sole defense against tar path traversal. This vulnerability is distinct from CVE-2025-12060 and other previously reported issues.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N"
} ],
"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-12482"
}, {
"type" : "WEB",
"url" : "https://github.com/keras-team/keras/pull/23015"
}, {
"type" : "WEB",
"url" : "https://github.com/keras-team/keras/pull/23165"
}, {
"type" : "WEB",
"url" : "https://github.com/keras-team/keras/commit/9867df45c456dd1077a6243bb56219f66e288150"
}, {
"type" : "WEB",
"url" : "https://github.com/keras-team/keras/commit/d338a45204bdc787c8b3c4a9b82c1911cd52dedf"
}, {
"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/5d3638e8-a9f6-4964-a865-ddb9fe4d4b6e"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-08-07T20:32:12Z",
"nvd_published_at" : "2026-07-14T06:16:59Z"
}
}