CVE-2026-12480: Keras HDF5 Virtual Datasets Can Disclose Vulnerability
MODERATECVE-2026-12480 is a MODERATE (CVSS 5.5) hdf5 virtual datasets can disclose vulnerability (CWE-73: External Control of File Name or Path) affecting Keras libraries in the PyPI ecosystem. The issue involves hdf5 virtual datasets can disclose local files. Remediation is available by upgrading affected packages to version 3.12.3, 3.15.0.
CVE-2026-12480 at a Glance
Security Impact
CVSS: 5.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N).
How to Fix CVE-2026-12480
To remediate this vulnerability, upgrade all affected Keras dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install keras>=3.12.3
pip install keras>=3.15.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show keras
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-12480, inspect your installed packages using pip:
pip show keras
Analyze the terminal output to locate any version of Keras in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.12.3), your application is affected.
Note: The pip show keras command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-73: External Control of File Name or Path, where the product allows user input to control or influence paths or file names that are used in filesystem operations. In Keras, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-12480 Affected Keras Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
keras
|
PyPI |
< 3.12.3
|
3.12.3
|
|
keras
|
PyPI |
≥ 3.13.0
< 3.15.0
|
3.15.0
|
References
Frequently Asked Questions
What is CVE-2026-12480?
Which Keras versions are affected?
What version fixes CVE-2026-12480?
Is keras affected?
What is the CVSS score of CVE-2026-12480?
What CWE is associated with CVE-2026-12480?
How can I check PyPI dependencies for CVE-2026-12480?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-26c4-7vv6-867j",
"modified" : "2026-08-07T20:28:58Z",
"published" : "2026-07-01T18:31:51Z",
"aliases" : [ "CVE-2026-12480" ],
"summary" : "Keras: HDF5 virtual datasets can disclose local files",
"details" : "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.3 and 3.15.0.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "keras"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.12.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "keras"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.13.0"
}, {
"fixed" : "3.15.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-12480"
}, {
"type" : "WEB",
"url" : "https://github.com/keras-team/keras/commit/8f987f11bf7512f0df4774a8f1557bba07dc2b49"
}, {
"type" : "WEB",
"url" : "https://github.com/keras-team/keras/commit/d5a88bdb137c0d3039b8f4bbbe8c7099925cc10c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/keras-team/keras"
}, {
"type" : "WEB",
"url" : "https://github.com/keras-team/keras/releases/tag/v3.12.3"
}, {
"type" : "WEB",
"url" : "https://github.com/keras-team/keras/releases/tag/v3.15.0"
}, {
"type" : "WEB",
"url" : "https://huntr.com/bounties/1875d257-5b03-4a69-ac70-e98653fa12c7"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-73" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-08-07T20:28:58Z",
"nvd_published_at" : "2026-07-01T17:16:19Z"
}
}