CVE-2026-12479 Path Traversal in keras-team/keras
Attackers can exploit path traversal in Keras model saving to write files to arbitrary locations, potentially leading to code execution.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-12479?
CVE-2026-12479 is a medium-severity path traversal vulnerability in keras-team/keras, published on 22 Jun 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
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.
Weakness: CWE-22
Which versions are affected by CVE-2026-12479?
5 open source packages ship an affected version, including keras.
| Package | Affected | Fixed in |
|---|---|---|
keras PyPI | All versions | 3.12.3, 3.15.0 |
keras PyPI | All versions | 3.12.3 |
keras PyPI | All versions | 3.12.3 |
keras PyPI | From 3.13.0 | 3.15.0 |
keras PyPI | From 3.13.0 | 3.15.0 |
How do I fix CVE-2026-12479?
Upgrade keras to a fixed version for your release line: 3.12.3 or 3.15.0.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2026-12479 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-12479 exists.
Sources
Also known as DEBIAN-CVE-2026-12479, GHSA-gh82-f9x8-5frx, MINI-q5h4-6hv4-cj9r, PYSEC-2026-3632, UBUNTU-CVE-2026-12479.