# 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.

- **Severity:** Medium 6.1 (`CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L`)
- **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:** Yes
- **Published:** 22 Jun 2026
- **Updated:** 22 Jun 2026
- **Also known as:** DEBIAN-CVE-2026-12479, GHSA-gh82-f9x8-5frx, MINI-q5h4-6hv4-cj9r, PYSEC-2026-3632, UBUNTU-CVE-2026-12479

## 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 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-12479?

5 open source packages ship an affected version, including keras.


| Package | Ecosystem | 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.

## Is CVE-2026-12479 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-12479 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-12479 and fix it if it is affected.

What it is: 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.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-12479 exists.

Affected packages and fixed versions:
- keras (PyPI): affected all versions; fixed in 3.12.3, 3.15.0
- keras (PyPI): affected all versions; fixed in 3.12.3
- keras (PyPI): affected all versions; fixed in 3.12.3
- keras (PyPI): affected from 3.13.0; fixed in 3.15.0
- keras (PyPI): affected from 3.13.0; fixed in 3.15.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-12479/ (Markdown: https://insights.sbomify.com/CVE-2026-12479/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-12479
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-12479
- OSV: https://osv.dev/vulnerability/CVE-2026-12479

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-12479/
Summaries are generated and may contain mistakes; the official description above is the record.
