Skip to main content

Keras CVE-2026-12570

| EUVDEUVD-2026-55002 MEDIUM
Allocation of Resources Without Limits or Throttling (CWE-770)
2026-08-10 @huntr_ai GHSA-74m6-m3xx-3vmj
5.5
CVSS 3.0 · Vendor: huntr_ai
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft HDF5 shape-bomb .keras file
  2. Delivery
    Publish to public model registry or repository
  3. Exploit
    Victim pipeline downloads malicious model file
  4. Execution
    keras.models.load_model() invoked on crafted file
  5. Persist
    H5IOStore allocates petabyte-scale declared memory without bounds check
  6. Impact
    OOM condition terminates process with exit code 137

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource allocation limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The target process must call keras.models.load_model() or load_weights() on a file controlled by the attacker - specifically a .keras archive or .weights.h5 file containing an HDF5 dataset with a maliciously large declared shape relative to its actual stored bytes (e.g., shape=(2**50,) with chunked gzip compression and a fill value). User interaction is required (UI:R per CVSS): a user or automated script must actively initiate the model load operation. The attack vector is local (AV:L per CVSS): the crafted file must reside on the local filesystem accessible to the loading process, meaning the attacker must first deliver the file via a poisoned model repository download, a compromised artifact registry, or a malicious model attachment. Pipelines with strict model provenance controls - such as cryptographic signature verification or allowlisted internal registries - are not exploitable in practice even on unpatched versions. Exploitation is limited strictly to the availability dimension; no code execution, credential theft, or data exfiltration is possible via this vector.

Impact

The CVSS base score of 5.5 (Medium) with a local attack vector (AV:L) and required user interaction (UI:R) constrains opportunistic exploitation in theory, but the practical risk in ML-intensive organizations substantially exceeds what the raw score implies. No EPSS score was provided in the available data, and the vulnerability is absent from the CISA KEV catalog, so no confirmed widespread active exploitation exists at time of analysis. However, automated model evaluation pipelines that pull from public model hubs or artifact registries may load files without direct human review, effectively collapsing the UI:R constraint to near-zero in operational practice - meaning even a mid-sized data science team in kalisz running a continuous-training pipeline against public model repositories should treat this as a meaningful supply-chain risk. The exploit technique is fully replicable from the upstream patch's own test suite, which constructs a 2^50-element gzip-compressed HDF5 dataset storing near-zero bytes on disk; this lowers the barrier to independent exploitation considerably even without a standalone PoC. The bypass of CVE-2026-0897's fix is noteworthy: it suggests the original remediation was incomplete in scope, and defenders who believed they had addressed the underlying class of attack should re-verify. The impact is strictly availability - no confidentiality or integrity exposure - which limits strategic value for sophisticated adversaries but makes this an effective denial-of-service primitive against ML infrastructure.

Exploit ScenarioDerived

An attacker publishes a Keras-compatible model to a public model hub, embedding an HDF5 dataset that declares a shape of 2^50 float64 elements (approximately 8 PiB in memory) while storing near-zero bytes on disk using chunked gzip compression with a fill value of 0.0. When a data scientist or CI/CD pipeline calls keras.models.load_model() on this file, h5py attempts to allocate the full declared memory, immediately exhausting available RAM and triggering a process kill with exit code 137. The construction technique is trivially replicable verbatim from the patch's own test suite using only h5py and a few lines of Python.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 10, 2026

Unbounded memory allocation in Keras (keras-team/keras) versions ≤ 3.15.0 allows an attacker who can supply a crafted .keras or HDF5 weights file to crash the loading process via an out-of-memory condition. The H5IOStore.__getitem__ method in keras/src/saving/saving_lib.py performs no validation of HDF5 dataset shapes against actual on-disk storage, enabling 'shape bomb' files that declare enormous in-memory sizes (e.g., ~8 PiB) while occupying negligible disk space. ML pipelines that consume models from public repositories, third-party registries, or untrusted collaborators are directly at risk; this flaw bypasses the earlier fix for CVE-2026-0897, which only addressed the same class of issue in KerasFileEditor. No public exploit has been identified at time of analysis and the vulnerability is not listed in the CISA KEV catalog.

RemediationAI

Apply the upstream fix from commit 4933ea4a5b3fcc24ceacdc276f5bb5dfbd06756c (https://github.com/keras-team/keras/commit/4933ea4a5b3fcc24ceacdc276f5bb5dfbd06756c); a specific patched release version is not independently confirmed from available data, so monitor the keras-team/keras PyPI releases for a version incorporating this commit and upgrade promptly. As an immediate workaround, restrict model loading to files sourced exclusively from internal, integrity-verified repositories by implementing SHA-256 or GPG signature verification on .keras and .weights.h5 files before passing them to load_model() or load_weights(); the trade-off is added pipeline complexity and key management overhead. Where automated pipelines must consume external models, run load_model() inside a memory-limited subprocess using Python's resource.setrlimit (RLIMIT_AS or RLIMIT_DATA) or container-level memory limits (e.g., Docker --memory), so an OOM crash is contained rather than propagating to the parent process; this mitigates impact but does not prevent the DoS. Enforcing strict model provenance policies - allowlisting only known-good model registries - directly addresses the primary attack vector described in the disclosure.

Affected VersionsENISA

keras-team/keras unspecified <3.12.3, 3.15.0

Affected Packages

pypi keras fix: 3.15.0
euvd keras_team_keras_unspecified_3_12_3 no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in pypi, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Keras serializes and deserializes neural network weights using the HDF5 format via the h5py library. The affected code path is H5IOStore.__getitem__ → safe_get_h5_dataset in keras/src/saving/saving_lib.py (CPE: cpe:2.3:a:keras-team:keras-team/keras:*:*:*:*:*:*:*:*). HDF5 supports chunked, compressed datasets with fill values, meaning a dataset can declare an arbitrarily large logical shape while storing almost nothing on disk - a pattern sometimes called a 'shape bomb' or 'decompression bomb,' closely related to CWE-409 (Improper Handling of Highly Compressed Data). The root cause is CWE-770 (Allocation of Resources Without Limits or Throttling): safe_get_h5_dataset does not compare the declared in-memory footprint (shape × dtype.itemsize) against the actual bytes stored on disk (dataset.id.get_storage_size()), so carefully crafted HDF5 metadata can force gigabytes or petabytes of memory allocation. The patch introduces a 4 GiB floor threshold (_H5_DATASET_BOMB_FLOOR_BYTES = 1 << 32) and a 1000× maximum expansion ratio (_H5_DATASET_MAX_EXPANSION) before any allocation proceeds, rejecting datasets that exceed both limits.

Know when Keras Team Keras gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (huntr_ai) PRIMARY 5.5 MEDIUM
AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
vuln.today AI 5.5 MEDIUM

AV:L because exploitation requires the crafted file to be present on the local filesystem; UI:R since a user or pipeline must actively invoke load_model(); A:H for guaranteed deterministic process termination; no confidentiality or integrity impact.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Red Hat 5.0 MEDIUM

Primary rating from Vendor (huntr_ai).

CVSS VectorVendor: huntr_ai

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

2
Patch available
Aug 10, 2026 - 08:02 EUVD
CVE Published
Aug 10, 2026 - 06:29 cve.org
MEDIUM 5.5

DescriptionCVE.org

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.

Threat Intelligence Overview

EPSS Score
0.1%
Top 97% exploitable
Prevalence
High
widely used deep learning framework across ML research and production pipelines
Data Quality
7 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
High

Priority Score

28
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +28
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy