Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious .keras model with TFSMLayer SavedModel
-
DeliveryDistribute via model hub or direct delivery
-
ExploitVictim loads model with safe_mode=True
-
Executionfrom_config loads external SavedModel unvalidated
-
PersistAttacker code runs during inference
-
ImpactCompromise 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv5 – 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)
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.
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.
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.
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
Affected Packages
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
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
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.
Primary rating from Vendor (huntr_ai).
CVSS VectorVendor: huntr_ai
Lifecycle Timeline
7DescriptionCVE.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- 7 pypi packages depend on keras (5 direct, 2 indirect)
Ecosystem-wide dependent count for version 3.13.2.
Executive ViewAI
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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.
More in Keras Team Keras
View allArbitrary code execution in keras-team/keras 3.14.0 lets remote attackers run OS-level commands by supplying a malicious
Local HDF5 file content disclosure in keras-team/keras versions 3.14.0 and earlier allows an attacker who can deliver a
Symlink entries in malicious tar archives bypass the `filter_safe_tarinfos` validation in Keras 3.12.0, enabling directo
Path traversal in Keras 3.14.0 exposes local file systems to arbitrary file and directory creation when processing malic
Unbounded memory allocation in Keras (keras-team/keras) versions ≤ 3.15.0 allows an attacker who can supply a crafted .k
EUVD-2026-21970
GHSA-4f3f-g24h-fr8m
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB