CVE-2025-49655
Python vulnerability analysis and mitigation

Overview

A critical vulnerability (CVE-2025-49655) was discovered in the Keras framework affecting versions 3.11.0 through 3.11.2. The vulnerability allows deserialization of untrusted data, enabling a maliciously uploaded Keras file containing a TorchModuleWrapper class to execute arbitrary code on an end user's system when loaded, even with safe mode enabled. The vulnerability was disclosed on October 17, 2025, and received a CVSS score of 9.8 (Critical) (NVD, HiddenLayer).

Technical details

The vulnerability exists in the TorchModuleWrapper class's fromconfig method, which uses torch.load() with weightsonly=False parameter. This configuration causes Torch to fall back on Python's pickle module for deserialization, which is known to be unsafe. The vulnerability is tracked as CWE-502 (Deserialization of Untrusted Data) and can be triggered through both local and remote files. The issue affects systems using PyTorch as the backend (KERASBACKEND="torch"), while configurations using JAX, TensorFlow, or OpenVINO remain unaffected ([HiddenLayer](https://hiddenlayer.com/saisecurity_advisor/2025-10-keras/), Security Online).

Impact

The vulnerability allows attackers to execute arbitrary system commands on an end user's system by loading a maliciously crafted model file. The impact is particularly severe as it can be triggered even when Keras' safe mode is enabled. Attackers can embed malicious payloads into legitimate Keras model files (.keras) to deliver hidden payloads, making it a significant threat to ML supply chain security (Security Online).

Mitigation and workarounds

The vulnerability has been patched in Keras version 3.11.3. Users are strongly advised to upgrade to this version or later. The fix involves adding a security check in the TorchModuleWrapper.fromconfig method that verifies if insafe_mode() flag is active and raises a ValueError if true, preventing the unsafe deserialization of torch.nn.Module objects (GitHub PR).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-67511CRITICAL9.6
  • PythonPython
  • cai-framework
NoNoDec 09, 2025
CVE-2025-66645HIGH7.5
  • PythonPython
  • nicegui
NoYesDec 09, 2025
GHSA-9rwj-6rc7-p77cHIGH7.3
  • PythonPython
  • langgraph-checkpoint-sqlite
NoYesDec 10, 2025
CVE-2025-67502MEDIUM5.4
  • PythonPython
  • taguette
NoYesDec 10, 2025
CVE-2025-67485MEDIUM5.3
  • PythonPython
  • mad-proxy
NoNoDec 09, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management