CVE-2025-49655
Python vulnerability analysis and mitigation

Overview

A critical deserialization vulnerability (CVE-2025-49655) was discovered in the Keras framework 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 discovered in October 2025 and affects both local and remote file loading capabilities (NVD, HiddenLayer).

Technical details

The vulnerability exists in the TorchModuleWrapper class's fromconfig method, which uses torch.load() with weightsonly=False parameter. This implementation causes Torch to utilize Python's pickle module for deserialization, which is known to be unsafe. The vulnerability allows attackers to craft malicious payloads that can execute arbitrary commands during the deserialization process. The issue has been assigned a CVSS v3.1 base score of 9.8 (CRITICAL) with vector AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H and is categorized as CWE-502: Deserialization of Untrusted Data (HiddenLayer).

Impact

The vulnerability enables attackers to execute arbitrary code on the target system when a malicious Keras model file is loaded. This can occur even when safe mode is enabled, affecting both local file loading and remote model loading through 'hf:' links. The impact is particularly severe as it requires no special privileges and can be triggered through normal model loading operations (HiddenLayer).

Mitigation and workarounds

The vulnerability has been patched in version 3.11.3 of the Keras framework. The fix involves disabling torch.load in TorchModuleWrapper when in safe mode and implementing proper validation of deserialized data. Users are strongly advised to upgrade to version 3.11.3 or later to protect against this vulnerability (GitHub PR).

Community reactions

The vulnerability was responsibly disclosed to the Keras team on July 30, 2025, with the vendor acknowledging receipt on August 1, 2025. A fix was published on August 13, 2025, followed by public disclosure on October 17, 2025. The security community has emphasized the severity of the vulnerability due to its potential for remote code execution (HiddenLayer).

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-62515CRITICAL9.8
  • PythonPython
  • pyquokka
NoNoOct 17, 2025
CVE-2025-49655CRITICAL9.8
  • PythonPython
  • keras
NoYesOct 17, 2025
CVE-2025-11849MEDIUM6.4
  • JavaScriptJavaScript
  • Mammoth
NoYesOct 17, 2025
CVE-2025-62172MEDIUM5.3
  • PythonPython
  • homeassistant
NoYesOct 14, 2025
CVE-2025-62379LOW3.1
  • PythonPython
  • reflex
NoNoOct 15, 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