Vulnerabilities in pkg:pypi/keras

PACKAGE
Advisory Identifier: GHSA-74m6-m3xx-3vmj
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.

26 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/keras

26 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/keras. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-74m6-m3xx-3vmj CVE-2026-12570 MODERATE Keras model loading is vulnerable to denial of service through HDF5 shape bombs
GHSA-m8wh-29wm-52mv CVE-2026-9335 MODERATE Keras: HDF5 links can disclose local file contents
GHSA-v2w2-w228-c444 CVE-2026-12484 HIGH Keras: TorchModuleWrapper can deserialize unsafe PyTorch pickle data
GHSA-58hv-7753-xmfq CVE-2026-12482 LOW Keras: tar extraction permits symlink-based path traversal
GHSA-5gwj-m78q-7pq3 CVE-2026-12481 HIGH Keras: Lambda deserialization can bypass safe mode and execute code
GHSA-26c4-7vv6-867j CVE-2026-12480 MODERATE Keras: HDF5 virtual datasets can disclose local files
GHSA-gh82-f9x8-5frx CVE-2026-12479 MODERATE Keras: DiskIOStore permits path traversal through crafted layer names
GHSA-hqp4-2352-xf5r CVE-2026-11816 HIGH Keras archive extraction utilities allow path traversal and arbitrary file writes
GHSA-mgx6-5cf9-rr43 CVE-2026-0897 HIGH Keras vulnerable to DoS via Malicious .keras Model (HDF5 Shape Bomb Causes Petabyte Allocation in KerasFileEditor)
GHSA-36rr-ww3j-vrjv CVE-2025-9905 HIGH The Keras `Model.load_model` method **silently** ignores `safe_mode=True` and allows arbitrary code execution when a `.h5`/`.hdf5` file is loaded.
GHSA-48g7-3x6r-xfhp CVE-2025-1550 HIGH Arbitrary Code Execution via Crafted Keras Config for Model Loading
GHSA-cjgq-5qmw-rcj6 CVE-2024-55459 MODERATE keras Path Traversal vulnerability
GHSA-36fq-jgmw-4r9c CVE-2025-9906 HIGH Keras is vulnerable to Deserialization of Untrusted Data
GHSA-c9rc-mg46-23w3 CVE-2025-8747 HIGH Keras vulnerable to CVE-2025-1550 bypass via reuse of internal functionality
GHSA-xfhx-r7ww-5995 - HIGH Duplicate Advisory: Google Keras Allocates Resources Without Limits or Throttling in the HDF5 weight loading component
GHSA-4f3f-g24h-fr8m CVE-2026-1462 HIGH Keras has an untrusted deserialization vulnerability
GHSA-3m4q-jmj6-r34q CVE-2026-1669 HIGH Keras has a Local File Disclosure via HDF5 External Storage During Keras Weight Loading
GHSA-gfmx-qqqh-f38q - HIGH Duplicate Advisory: Keras vulnerable to arbitrary file read in the model loading mechanism (HDF5 integration)
GHSA-hjqc-jx6g-rwp9 CVE-2025-12060 HIGH Keras Directory Traversal Vulnerability
GHSA-28jp-44vh-q42h - HIGH Duplicate Advisory: Keras keras.utils.get_file API is vulnerable to a path traversal attack
GHSA-mq84-hjqx-cwf2 CVE-2025-12058 MODERATE Keras is vulnerable to arbitrary local file loading and Server-Side Request Forgery
GHSA-cvhh-q5g5-qprp CVE-2025-49655 CRITICAL Keras framework vulnerable to deserialization of untrusted data
GHSA-77wq-646f-jrm2 - HIGH Duplicate Advisory: The Keras `Model.load_model` method **silently** ignores `safe_mode=True` and allows arbitrary code execution when a `.h5`/`.hdf5` file is loaded.
GHSA-pwq7-2gvj-vg9v - HIGH Duplicate Advisory: Keras safe mode bypass vulnerability
GHSA-5478-v2w6-c6q7 - HIGH Duplicate Advisory: Keras arbitrary code execution vulnerability
GHSA-x4wf-678h-2pmq CVE-2024-3660 CRITICAL Keras code injection vulnerability

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"
  }
}