CVE-2025-12060
HIGH 8.9CVSS 4.0Keras Directory Traversal Vulnerability
The keras.utils.get_file API in Keras, when used with the extract=True option for tar archives, is vulnerable to a path traversal attack. The utility uses Python's tarfile.extractall function without the filter="data" feature. A remote attacker can craft a malicious tar archive containing special symlinks, which, when extracted, allows them to write arbitrary files to any location on the filesystem outside of the intended destination folder. This vulnerability is linked to the underlying Python tarfile weakness, identified as CVE-2025-4517. Note that upgrading Python to one of the versions that fix CVE-2025-4517 (e.g. Python 3.13.4) is not enough. One additionally needs to upgrade Keras to a version with the fix (Keras 3.12).
- Published
- 30 Oct 2025
- Last modified
- 19 Oct 2026
- Assigned by
- cve-coordination@google.com
- NVD status
- Deferred
- Weakness
- CWE-22
- Also known as
- GHSA-hjqc-jx6g-rwp9PYSEC-2026-1486
- Sources
- NVDJSONOSV GHSA-hjqc-jx6g-rwp9JSONOSV PYSEC-2026-1486JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | cve-coordination@google.com (Secondary) | CVSS 4.0 | HIGH 8.9 | CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H | |
| OSV | PyPA | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H | |
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | PyPA | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | PyPI | keras | < 3.12.0 | 3.12.0 |
References
- https://github.com/keras-team/keras/pull/21760 · WEB
- https://github.com/keras-team/keras/security/advisories/GHSA-hjqc-jx6g-rwp9 · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2025-12060 · ADVISORY
- https://nvd.nist.gov/vuln/detail/CVE-2025-12638 · ADVISORY
- https://github.com/keras-team/keras/commit/47fcb397ee4caffd5a75efd1fa3067559594e951 · WEB
- https://github.com/keras-team/keras · PACKAGE
- https://huntr.com/bounties/f94f5beb-54d8-4e6a-8bac-86d9aee103f4 · WEB
- https://pypi.org/project/keras · PACKAGE
- https://github.com/advisories/GHSA-hjqc-jx6g-rwp9 · ADVISORY
History
- 25 Nov 2026 20:59 UTC · NVD: first stored (published 30 Oct 2025)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 7 Jul 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 2 Dec 2025)