CVE-2026-12570: Keras Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-74m6-m3xx-3vmj
CVSS 5.5
CWE-770
Published
Advisory Summary

CVE-2026-12570 is a MODERATE (CVSS 5.5) denial of service vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Keras libraries in the PyPI ecosystem. The issue involves keras model loading is vulnerable to denial of service through hdf5 shape bombs. Remediation is available by upgrading affected packages to version 3.15.0.

CVE-2026-12570 at a Glance

CVE Identifier CVE-2026-12570
GHSA Identifier GHSA-74m6-m3xx-3vmj
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
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:N/I:N/A:H).

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 None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-12570

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.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-12570, 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.15.0), 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. 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

A vulnerability in keras-team/keras versions < 3.15.0 allows for a denial of service (DoS) attack when loading malicious .keras model files via the keras.models.load_model() function. The H5IOStore.__getitem__ method in keras/src/saving/saving_lib.py does not validate the shape or size of datasets, leading to unbounded memory allocation. A specially crafted .keras file can exploit this flaw to trigger an out-of-memory (OOM) condition, causing the process to be terminated (exit code 137). This issue bypasses the fix for CVE-2026-0897, which only addressed a similar vulnerability in KerasFileEditor. The attack vector includes poisoned models from public repositories or malicious model registries, posing a risk to machine learning pipelines that process untrusted models.

CVE-2026-12570 Affected Keras Versions

1 component(s)
Fixed Versions:
3.15.0
Product / Package Ecosystem Affected Versions Fixed Version
keras
PyPI
< 3.15.0
3.15.0

References

Frequently Asked Questions

What is CVE-2026-12570?
CVE-2026-12570 is a security vulnerability in Keras involving Keras model loading is vulnerable to denial of service through HDF5 shape bombs under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Keras versions are affected?
Affected versions include releases prior to 3.15.0 across affected packages: keras.
What version fixes CVE-2026-12570?
Upgrading to 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.15.0. Upgrade your dependency to 3.15.0 or later.
What is the CVSS score of CVE-2026-12570?
CVE-2026-12570 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:N/I:N/A:H.
What CWE is associated with CVE-2026-12570?
CVE-2026-12570 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check PyPI dependencies for CVE-2026-12570?
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-74m6-m3xx-3vmj",
  "modified" : "2026-09-01T20:22:06Z",
  "published" : "2026-08-10T09:31:20Z",
  "aliases" : [ "CVE-2026-12570" ],
  "summary" : "Keras model loading is vulnerable to denial of service through HDF5 shape bombs",
  "details" : "A vulnerability in keras-team/keras versions < 3.15.0 allows for a denial of service (DoS) attack when loading malicious .keras model files via the keras.models.load_model() function. The H5IOStore.__getitem__ method in keras/src/saving/saving_lib.py does not validate the shape or size of datasets, leading to unbounded memory allocation. A specially crafted .keras file can exploit this flaw to trigger an out-of-memory (OOM) condition, causing the process to be terminated (exit code 137). This issue bypasses the fix for CVE-2026-0897, which only addressed a similar vulnerability in KerasFileEditor. The attack vector includes poisoned models from public repositories or malicious model registries, posing a risk to machine learning pipelines that process untrusted models.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "keras"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.15.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-12570"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/keras-team/keras/pull/22975"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/keras-team/keras/commit/4933ea4a5b3fcc24ceacdc276f5bb5dfbd06756c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/keras-team/keras"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/keras-team/keras/releases/tag/v3.15.0"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/a064f475-780a-409a-82f7-678512f27ad8"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-01T20:22:06Z",
    "nvd_published_at" : "2026-08-10T07:16:44Z"
  }
}