CVE-2025-8747
Python vulnerability analysis and mitigation

Overview

A safe mode bypass vulnerability (CVE-2025-8747) was discovered in the Model.load_model method in Keras versions 3.0.0 through 3.10.0. The vulnerability allows an attacker to achieve arbitrary code execution by convincing a user to load a specially crafted .keras model archive (NVD, JFrog Blog).

Technical details

The vulnerability exists in the deserialization mechanism of Keras models, specifically in the handling of Lambda layers. Even with safemode enabled, attackers can exploit the deserialization process through the Keras Functional API to execute arbitrary functions. Prior to version 3.9, attackers could reference functions from any module available for import. After version 3.9, while external module access was restricted, the vulnerability could still be exploited using internal Keras functions like keras.utils.get_file. The vulnerability has received a CVSS v3.1 base score of 7.8 (HIGH) with vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H (NVD, [JFrog Blog](https://jfrog.com/blog/keras-safemode-bypass-vulnerability/)).

Impact

The vulnerability allows attackers to achieve arbitrary code execution on the victim's system. This can lead to various malicious activities, including downloading and executing malicious files, accessing sensitive system resources, and potentially gaining full system access. For example, attackers could exploit the vulnerability to download malicious files to arbitrary locations on the victim's file system (JFrog Blog).

Mitigation and workarounds

The issue was partially addressed in Keras version 3.9 by restricting function loading to only the Keras module namespace. However, this fix is incomplete as certain internal Keras functions can still be exploited. A complete fix was implemented in version 3.11.0. Users are advised to upgrade to the latest version of Keras and implement proper sandboxing and security scanning of untrusted ML models (GitHub PR, JFrog Blog).

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-58757HIGH8.8
  • PythonPython
  • monai
NoNoSep 09, 2025
CVE-2025-58756HIGH8.8
  • PythonPython
  • monai
NoNoSep 09, 2025
CVE-2025-58755HIGH8.8
  • PythonPython
  • monai
NoNoSep 09, 2025
CVE-2025-58180HIGH7.5
  • PythonPython
  • octoprint
NoYesSep 09, 2025
CVE-2025-58753MEDIUM5.3
  • PythonPython
  • copyparty
NoYesSep 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