Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious Torch pickle in Keras layer config
-
DeliveryDistribute config via model hub or shared file
-
ExploitVictim calls TorchModuleWrapper.from_config
-
Executiontorch.load(weights_only=False) unpickles payload
-
ImpactArbitrary code execution in victim context
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 that a victim application or user deserialize an attacker-controlled Keras layer configuration via keras.layers.TorchModuleWrapper.from_config while NOT inside a SafeModeScope(True) context (the default state), on the PyTorch backend where torch.load is used. The concrete prerequisites are: (1) use of the TorchModuleWrapper / PyTorch backend, and (2) processing of an untrusted config through from_config without an active Keras safe-mode scope. Limiting factors per the CVSS vector: exploitation is local (AV:L) and requires user interaction (UI:R) - the attacker cannot trigger it remotely without the victim loading the malicious config - and it does not apply to pipelines that only ever load first-party/trusted models or that already enforce SafeModeScope(True) around deserialization. |
| Impact | The supplied CVSS 3.0 vector (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H, base 7.8) is internally consistent with the description: exploitation is not a remote network service compromise but rather requires a victim to load an attacker-supplied config, hence AV:L and UI:R, while the payload yields full code execution (C:H/I:H/A:H). No EPSS score, KEV entry, POC reference, or SSVC decision data was provided, so exploitation-probability signals are absent - the only corroborating signal is the huntr researcher submission and the Deserialization/RCE tags. This is a genuine, high-impact issue for anyone in an ML supply-chain or model-sharing scenario (loading models from Hugging Face-style hubs, shared checkpoints, or multi-tenant pipelines), but it is not a mass-scannable internet-facing bug: the UI:R requirement means it depends on convincing a target to deserialize a hostile config, so real-world risk is elevated for ML/MLOps environments handling untrusted models and comparatively low for isolated first-party deployments. Note the vector is authored as CVSS:3.0 rather than 3.1, and no independent EPSS/KEV data was available to confirm or contradict prioritization. |
| Exploit ScenarioDerived | An attacker publishes a seemingly benign Keras model or layer configuration (e.g., on a public model hub or shared via a colleague) whose serialized TorchModuleWrapper state embeds a malicious pickle payload. When a data scientist or an automated MLOps pipeline loads that config through from_config outside a SafeModeScope(True), torch.load(weights_only=False) unpickles the payload and executes arbitrary code in the victim's context. No public POC is referenced in the input, but crafting a pickle __reduce__ gadget for this class of flaw is straightforward. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 19, 2026
Arbitrary code execution in keras-team/keras 3.15.0 arises because the public keras.layers.TorchModuleWrapper.from_config method calls torch.load(..., weights_only=False) without any explicit unsafe opt-in, so a maliciously crafted Keras layer configuration deserialized outside a SafeModeScope(True) context triggers execution of attacker-controlled PyTorch pickle payloads (CWE-502). Any application or pipeline that loads untrusted or third-party Keras model/layer configs is affected; CVSS is 7.8 (High) with a local vector requiring user interaction. There is no public exploit identified at time of analysis and the flaw is not listed in CISA KEV, but the vulnerability class is well understood and reliably weaponizable via standard pickle reduce gadgets.
RemediationAI
No vendor-released patch version is identified in the provided data, so a specific fixed release cannot be cited - consult the huntr advisory (https://huntr.com/bounties/ab14df49-13b5-4442-b754-3189430bfa28) and the keras-team/keras releases for an upgraded version and apply it once published. As the primary compensating control, never call TorchModuleWrapper.from_config (or deserialize Keras models/layers) on configurations from untrusted or unverified sources; treat model files like executable code. Where deserialization of external configs is unavoidable, wrap the operation in a SafeModeScope(True) context so Keras safe mode blocks the unsafe torch.load path - with the trade-off that legitimate configs relying on that Torch-wrapper load will fail and must be sourced only from trusted parties. Additionally, isolate model-loading in a sandboxed, least-privilege process or container without network egress or sensitive credentials to limit blast radius if a hostile config is loaded, accepting the added operational complexity of a separate deserialization service.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
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 neural-network API; version 3 (Keras Core) supports multiple backends including PyTorch, and TorchModuleWrapper is the adapter that embeds a native torch.nn.Module inside a Keras layer. Model/layer serialization in Keras round-trips through get_config/from_config dictionaries, and for the Torch wrapper the persisted state is restored via torch.load. PyTorch's torch.load defaults to the pickle protocol, and with weights_only=False it will unpickle arbitrary Python objects - invoking __reduce__ methods that can run any code during load. The root cause (CWE-502, Deserialization of Untrusted Data) is that from_config performs this unsafe load unconditionally: Keras has a safe-mode mechanism (SafeModeScope) intended to block unsafe deserialization, but this code path only honors it when a SafeModeScope(True) is already active and provides no per-call safe_mode=False gate, so the insecure behavior is the default rather than an explicit, audited opt-in.
Know when the next one hits your stack
- 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
Exploitation needs a victim to load an untrusted config (AV:L, UI:R) with no auth (PR:N), and unpickling yields full code execution, so C/I/A all High.
Primary rating from Vendor (huntr).
CVSS VectorVendor: huntr
DescriptionCVE.org
A vulnerability in keras-team/keras version 3.15.0 allows unsafe deserialization of attacker-controlled PyTorch pickle data through the public keras.layers.TorchModuleWrapper.from_config method. This method invokes torch.load(..., weights_only=False) without requiring an explicit unsafe opt-in, such as a safe_mode=False parameter. When called outside a SafeModeScope(True) context, the absence of an ambient safe mode state permits unsafe deserialization by default. This issue can lead to arbitrary code execution if untrusted Keras layer configurations are processed using this method. The vulnerability arises because the method does not enforce safe deserialization practices unless explicitly guarded by Keras safe mode.
Blast Radius
ecosystem impact- 1 pypi packages depend on keras (1 direct, 0 indirect)
Ecosystem-wide dependent count for version 3.13.0.
Executive ViewAI
Keras 3.15.0 contains an arbitrary code execution vulnerability triggered when deserializing externally sourced or user-supplied model configurations, creating risk for organizations that accept model uploads or integrate third-party machine learning assets. Exploitation could compromise application integrity, enable data exfiltration, and facilitate lateral movement within infrastructure.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Wrap keras.layers.TorchModuleWrapper.from_config calls within SafeModeScope(True) to restrict pickle gadget execution; (2) disable model loading from untrusted external sources; (3) implement file-type validation and size limits on model uploads; (4) execute model deserialization in isolated, low-privilege containers with restricted network egress.
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.
EUVD-2026-45872
GHSA-v2w2-w228-c444
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB