# CVE-2026-12480: Arbitrary HDF5 File Read via Virtual Dataset Bypass in keras-team/keras

> Attackers can read arbitrary files from the victim's filesystem by crafting malicious Keras model files that exploit virtual dataset handling flaws.

- **Severity:** Medium 5.5 (`CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N`)
- **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:** 1 Jul 2026
- **Updated:** 1 Jul 2026
- **Also known as:** AZL-92027, DEBIAN-CVE-2026-12480, GHSA-26c4-7vv6-867j, MINI-53c4-pr5f-8h8m, PYSEC-2026-3629, UBUNTU-CVE-2026-12480

## What is CVE-2026-12480?

CVE-2026-12480 is a medium-severity path traversal vulnerability in keras-team/keras, published on 1 Jul 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

Keras versions up to and including 3.13.2 are vulnerable to an arbitrary HDF5 file read due to an incomplete fix for CVE-2026-1669. The vulnerability resides in the `H5IOStore._verify_dataset()` and `file_editor.py` methods, which fail to check the `dataset.is_virtual` property of HDF5 datasets. This allows an attacker to craft a malicious `.keras` model archive or `.h5` weights file containing a Virtual Dataset (VDS) that references external HDF5 files on the victim's filesystem. When the victim loads the model using `keras.models.load_model()` or `keras.saving.load_model()`, the external file is transparently read, leading to potential information disclosure. Fixed in versions 3.12.2 and 3.14.1.

Weakness: CWE-73 (External Control of File Name or Path)

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

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-12480?

Upgrade keras to a fixed version for your release line: 3.12.3 or 3.15.0.

## Is CVE-2026-12480 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2026-12480 is a medium-severity path traversal vulnerability in keras-team/keras, published on 1 Jul 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-12480 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-12480/ (Markdown: https://insights.sbomify.com/CVE-2026-12480/index.md)
```

## Sources

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

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