Track vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
9.4
CVE-2025-12060: Keras download can overwrite any system file
CVE-2025-12060 · published 1 year ago
Summary
The Keras library’s file‑download function can extract tar archives without checking their contents. If an attacker supplies a specially crafted archive, it can place files anywhere on your server, potentially overwriting important data. Update Keras to version 3.12 or later to stop this behavior.
What to do
- Update keras team keras to version 3.12.0.
- Update keras to version 3.11.3+aikido.2.
- Update keras to version 3.11.3+aikido.3.
Affected software
| Ecosystem | Vendor | Product | Affected versions |
|---|---|---|---|
| pip | keras team | keras |
<= 3.11.3 Fix: upgrade to 3.12.0
|
| Root:PyPI | – | keras |
< 3.11.3+aikido.2 < 3.11.3+aikido.3 Fix: upgrade to 3.11.3+aikido.2
|
| Debian:11 | debian | keras | All versions |
| Ubuntu:18.04:LTS | canonical | keras | All versions |
Original advisory text
CVE-2025-12060 in keras - Patched by Root
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).
References
- https://nvd.nist.gov/vuln/detail/CVE-2025-12638
- https://github.com/keras-team/keras/commit/47fcb397ee4caffd5a75efd1fa3067559594e...
- https://huntr.com/bounties/f94f5beb-54d8-4e6a-8bac-86d9aee103f4
- https://github.com/advisories/GHSA-hjqc-jx6g-rwp9
- https://nvd.nist.gov/vuln/detail/CVE-2025-12060 Vendor Advisory
- https://github.com/keras-team/keras/ URL
- https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/12xxx/CVE-2025-12060... Vendor Advisory
- https://security-tracker.debian.org/tracker/CVE-2025-12060 Vendor Advisory
- https://ubuntu.com/security/CVE-2025-12060 Third Party Advisory
- https://www.cve.org/CVERecord?id=CVE-2025-12060 Third Party Advisory
- https://github.com/keras-team/keras/pull/21760 Third Party Advisory
- https://github.com/keras-team/keras/security/advisories/GHSA-hjqc-jx6g-rwp9 Third Party Advisory
Internet-facing
14 days
Internal
At next upgrade
- Not known to be exploited
- Needs hands-on effort to exploit
- Gives an attacker full control
Severity
9.4
Critical
Type
CWE-22Path Traversal
Timeline
Published30 Oct 2025
Updated3 Dec 2026
First seen6 Mar 2026
Sources
GHSA-hjqc-jx6g-rwp9 · GHSA
CVE-2025-12060 · NVD
CVE-2025-12060 · OSV
DEBIAN-CVE-2025-12060 · OSV
UBUNTU-CVE-2025-12060 · OSV
Track software like this
Free during beta