Skip to main content

Keras EUVDEUVD-2026-21970

| CVE-2026-1462 HIGH
Deserialization of Untrusted Data (CWE-502)
2026-04-13 @huntr_ai GHSA-4f3f-g24h-fr8m
7.8
CVSS 3.1 · Vendor: huntr_ai
View

Attack ChainAIDerived

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

  1. Access
    Craft malicious .keras model with TFSMLayer SavedModel
  2. Delivery
    Distribute via model hub or direct delivery
  3. Exploit
    Victim loads model with safe_mode=True
  4. Execution
    from_config loads external SavedModel unvalidated
  5. Persist
    Attacker code runs during inference
  6. Impact
    Compromise under victim privileges

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V1 - Encoding and Sanitization Safe deserialization, type allowlists
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

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

Exploitation Conditions

Exploitation requires the victim to deserialize/load an attacker-crafted .keras model that uses the TFSMLayer class referencing an external attacker-controlled TensorFlow SavedModel path; the bug specifically defeats the safe_mode=True setting, so even users who enabled that protection are exposed. Limiting factors: the attack is local with required user interaction (CVSS AV:L, UI:R) - the attacker cannot trigger it remotely without first getting the victim to obtain and load the malicious model file, and code runs only at the victim's privilege level. It affects keras-team/keras 3.13.0 (versions <3.13.2); upgrading removes the condition. No authentication is involved on the victim side (PR:N), but successful attack depends entirely on luring the victim into loading the model.

Impact

Signals are internally consistent and point to a real-but-bounded threat. The CVSS 3.1 vector (AV:L/AC:L/PR:N/UI:R, C:H/I:H/A:H = 7.8 High) shows full triad impact but requires local delivery and victim interaction (loading the model). SSVC aligns: Exploitation=poc (not active), Automatable=no (a human must be lured into opening the model), Technical Impact=total. EPSS is only 0.06% (19th percentile) and the CVE is NOT in CISA KEV, so there is no evidence of mass or active exploitation - appropriate, since this is a supply-chain/social-engineering style vector rather than a remotely sprayable one. The practical risk is highest for ML/MLOps pipelines that ingest third-party or community-shared models (e.g., from public hubs) and wrongly rely on safe_mode=True as a trust boundary. No data conflicts were observed: the local vector matches the description's requirement that a victim deserialize the attacker's model.

Exploit ScenarioDerived

An attacker publishes a seemingly benign pretrained .keras model to a public model hub or sends it directly to a data scientist. When the victim loads it (even with safe_mode=True), the embedded TFSMLayer references an attacker-controlled SavedModel that executes arbitrary code during inference under the victim's privileges. A public proof-of-concept exists via the huntr bounty report, lowering the effort to reproduce.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.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

AnalysisAIv5 – Jun 30, 2026

Arbitrary code execution in Keras 3.13.0 occurs because the TFSMLayer class unconditionally loads attacker-supplied TensorFlow SavedModels while deserializing a .keras model, even with safe_mode=True engaged. Any user who loads a malicious model triggers attacker-controlled code at inference time under their own privileges, defeating the protection safe_mode is supposed to provide. The flaw (CWE-502) has publicly available exploit code via huntr but is not in CISA KEV; EPSS is very low at 0.06% (19th percentile), consistent with the local, user-interaction-dependent attack path.

Earlier versions of this analysis (4)
v4 Jun 30, 2026 - 04:37 cvss changed CVSS 7.8

Arbitrary code execution in Keras 3.13.0 lets a malicious .keras model run attacker-controlled TensorFlow SavedModel graph code at inference time even with safe_mode=True, because the TFSMLayer class loads external SavedModels unconditionally during deserialization. The flaw (CWE-502) affects victims who load untrusted models built with TFSMLayer and silently defeats the safe_mode guarantee that is supposed to block exactly this class of code-loading layer. Publicly available exploit code exists (reported via huntr, SSVC exploitation status 'poc'); EPSS is low at 0.06% (19th percentile) and it is not in CISA KEV.

v3 Jun 30, 2026 - 04:36 cvss changed CVSS 7.8

Arbitrary code execution in Keras 3.13.0 (and earlier, fixed in 3.13.2) arises when the TFSMLayer class loads an attacker-controlled TensorFlow SavedModel during deserialization of a crafted .keras model, even with safe_mode=True. A victim who loads a malicious model triggers execution of attacker-supplied TensorFlow graph code under their own privileges. No public exploit is identified at time of analysis; SSVC records proof-of-concept maturity and EPSS is low (0.06%), reflecting the user-interaction requirement of loading an untrusted model file.

v2 Jun 30, 2026 - 04:36 cvss changed CVSS 7.8

Arbitrary code execution in Keras 3.13.0 allows a malicious .keras model file to run attacker-controlled code during deserialization even when safe_mode=True, by abusing the TFSMLayer class to load an attacker-supplied TensorFlow SavedModel. Any user or pipeline that loads an untrusted model is affected; publicly available exploit code exists (reported via huntr.com) and SSVC rates technical impact as total, though EPSS is low at 0.06%. The flaw is fixed in Keras 3.13.2.

v1 Apr 13, 2026 - 15:39 CVSS 8.8

Remote code execution in Keras 3.13.0 allows unauthenticated attackers to execute arbitrary code by crafting malicious .keras model files that load attacker-controlled TensorFlow SavedModels during deserialization, bypassing safe_mode protections. Exploitation requires user interaction (victim must load the malicious model), but no authentication is required to deliver the payload. EPSS data not available; no public exploit code or active exploitation confirmed at time of analysis, but the technical barrier is low given the detailed vulnerability disclosure.

RemediationAI

Primary fix: upgrade Keras to 3.13.2 or later, which contains the upstream fix (commit b6773d3decaef1b05d8e794458e148cb362f163f); the EUVD affected range (<3.13.2) confirms 3.13.2 as the patched line. Red Hat users should apply the platform errata RHSA-2026:24977. Until patched, treat all .keras model files as untrusted code: do not load models from untrusted or unverified sources, and avoid relying on safe_mode=True as a security boundary since this flaw bypasses it. As compensating controls, load untrusted models only inside a sandboxed/isolated environment (container with no network egress and least-privilege filesystem access) so any executed payload is contained - at the cost of added pipeline complexity; and where feasible avoid using TFSMLayer to wrap externally-supplied SavedModels, and validate the provenance/integrity (signing/hashes) of model artifacts before deserialization. Advisory and patch URLs: https://github.com/keras-team/keras/commit/b6773d3decaef1b05d8e794458e148cb362f163f and https://access.redhat.com/errata/RHSA-2026:24977.

Affected VersionsENISA

keras-team/keras unspecified <3.13.2

Affected Packages

pypi keras fix: 3.13.2
euvd keras_team_keras_unspecified fix: 3.13.2

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 is a high-level deep-learning API (here the standalone keras-team/keras 3.x stack on TensorFlow) whose native .keras archive format supports layer reconstruction via from_config(). The TFSMLayer wraps a TensorFlow SavedModel directory so a saved Graph can be reused as a Keras layer. The root cause is a classic CWE-502 deserialization-of-untrusted-data flaw: from_config() serializes and trusts an attacker-controlled filesystem path and unconditionally loads the referenced external SavedModel, with no validation and no enforcement of the safe_mode gate that normally blocks Lambda/arbitrary-callable deserialization. Because a SavedModel can embed arbitrary TensorFlow ops/custom code that execute when the graph runs, loading the crafted model results in code execution during inference. CPE cpe:2.3:a:keras-team:keras-team/keras identifies the affected component as the keras-team Keras package specifically.

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 7.8 HIGH
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 7.8 HIGH

Local because a victim must load the crafted model (AV:L, UI:R); no prior privileges needed (PR:N); deserialized code grants full host impact, so C/I/A all High.

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

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
High
Integrity
High
Availability
High

Lifecycle Timeline

7
Analysis Updated
Jun 30, 2026 - 04:37 vuln.today
v5 - CVSS changed
Analysis Updated
Jun 30, 2026 - 04:37 vuln.today
v4 - CVSS changed
Analysis Updated
Jun 30, 2026 - 04:36 vuln.today
v3 - CVSS changed
Analysis Updated
Jun 30, 2026 - 04:36 vuln.today
v2 - CVSS changed
CVSS changed
Jun 30, 2026 - 03:24 NVD
8.8 (HIGH) 7.8 (HIGH)
Patch released
Apr 15, 2026 - 02:30 nvd
Patch available
CVE Published
Apr 13, 2026 - 14:55 nvd
HIGH 8.8

DescriptionCVE.org

A vulnerability in the TFSMLayer class of the keras package, version 3.13.0, allows attacker-controlled TensorFlow SavedModels to be loaded during deserialization of .keras models, even when safe_mode=True. This bypasses the security guarantees of safe_mode and enables arbitrary attacker-controlled code execution during model inference under the victim's privileges. The issue arises due to the unconditional loading of external SavedModels, serialization of attacker-controlled file paths, and the lack of validation in the from_config() method.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 7 pypi packages depend on keras (5 direct, 2 indirect)

Ecosystem-wide dependent count for version 3.13.2.

Executive ViewAI

Why It Matters

Keras 3.13.0 contains an arbitrary code execution vulnerability in model deserialization that affects teams loading .keras model files. The vulnerability bypasses safe mode protections, creating risk for data science and ML pipeline workloads if malicious models are introduced. Publicly available exploit code exists, though exploitation likelihood is low (0.1% EPSS) given the user-interaction requirement.

Business Impact: High
Compensating Controls

Patch available per vendor advisory. Interim mitigations: restrict .keras model loading to signed, pre-validated models; implement model source validation; disable dynamic model loading in production; isolate Keras workloads in sandboxed containers with minimal privilege.

Threat Intelligence Overview

EPSS Score
0.1%
Top 81% exploitable
Prevalence
High
Keras is a very widely used deep-learning framework across ML/MLOps environments
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor CIRCL GitHub VulDB

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 HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.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
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

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

Attack Technique

Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Vendor StatusVendor

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