CVE-2026-12480: Keras HDF5 Virtual Datasets Can Disclose Vulnerability

MODERATE
Advisory Identifier: GHSA-26c4-7vv6-867j
CVSS 5.5
CWE-73
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-12480
GHSA Identifier GHSA-26c4-7vv6-867j
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-73: External Control of File Name or Path
Affected Product Keras
Package Ecosystem PyPI
Published Date
Last Updated

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

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (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.

keras fixed: 3.12.3
pip install keras>=3.12.3
keras fixed: 3.15.0
pip install keras>=3.15.0
Verify Direct and Transitive Dependencies

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

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.

CVE-2026-12480 Affected Keras Versions

2 component(s)
Fixed Versions:
3.12.33.15.0
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?
CVE-2026-12480 is a security vulnerability in Keras involving HDF5 virtual datasets can disclose local files under CWE-73: External Control of File Name or Path.
Which Keras versions are affected?
Affected versions include releases prior to 3.12.3, 3.15.0 across affected packages: keras.
What version fixes CVE-2026-12480?
Upgrading to 3.12.3, 3.15.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is keras affected?
Yes, keras is affected in releases prior to 3.12.3, 3.15.0. Upgrade your dependency to 3.12.3, 3.15.0 or later.
What is the CVSS score of CVE-2026-12480?
CVE-2026-12480 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-12480?
CVE-2026-12480 is classified under CWE-73: External Control of File Name or Path (The product allows user input to control or influence paths or file names that are used in filesystem operations.).
How can I check PyPI dependencies for CVE-2026-12480?
Run the dependency tree command: 'pip show keras'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}