CVE-2025-9906

Arbitrary Code execution in Keras Safe Mode

HIGH
7.3
CVSS Score
Published: September 19, 2025 at 08:15 AM UTC
Updated: October 19, 2026 at 04:10 PM UTC
1 product affected across 1 vendorKeras

Using Keras by Keras-team?

Get instant alerts when new vulnerabilities affect Keras - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.3
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

Description

The Keras Model.load_model method can be exploited to achieve arbitrary code execution, even with safe_mode=True. One can create a specially crafted .keras model archive that, when loaded via Model.load_model, will trigger arbitrary code to be executed. This is achieved by crafting a special config.json (a file within the .keras archive) that will invoke keras.config.enable_unsafe_deserialization() to disable safe mode. Once safe mode is disable, one can use the Lambda layer feature of keras, which allows arbitrary Python code in the form of pickled code. Both can appear in the same archive. Simply the keras.config.enable_unsafe_deserialization() needs to appear first in the archive and the Lambda with arbitrary code needs to be second.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

3.0.0 ≤ v < 3.11.03.0.0
Affected range stops below 3.11.0, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (1)

PatchIssue Tracking
Source: cverecord
https://github.com/keras-team/keras/pull/21429

SSVC — Action Prioritization

SSVCNo known exploitNot automatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-502

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card