CVE-2025-9905

HighCVSS 7.3/10Last modified Oct 19, 2026

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 .h5/.hdf5 model archive that, when loaded via Model.load_model, will trigger arbitrary code to be executed.

This is achieved by crafting a special .h5 archive file that uses the Lambda layer feature of keras which allows arbitrary Python code in the form of pickled code. The vulnerability comes from the fact that the safe_mode=True option is not honored when reading .h5 archives.

Note that the .h5/.hdf5 format is a legacy format supported by Keras 3 for backwards compatibility.

Metrics

CVSS 3.1 7.3/10CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

Weakness enumeration

Affected software

No affected versions have been published.

Timeline

Published
Sep 19, 2025
Last modified
Oct 19, 2026
NVD status
Analyzed

Related CVEs from 2025

CVE-2025-99067.3The Keras Model.load_model method can be exploited to achieve arbitrary code execution, even with safe_mode=True. One can create a speciallCVE-2025-99076.7A flaw was found in the Red Hat Ansible Automation Platform, Event-Driven Ansible (EDA) Event Stream API. This vulnerability allows exposureCVE-2025-99086.7A flaw was found in the Red Hat Ansible Automation Platform, Event-Driven Ansible (EDA) Event Streams. This vulnerability allows an authentiCVE-2025-99096.7A flaw was found in the Red Hat Ansible Automation Platform Gateway route creation component. This vulnerability allows credential theft viaCVE-2025-99104.7Versions of the package jsondiffpatch before 0.7.2 are vulnerable to Cross-site Scripting (XSS) via HtmlFormatter::nodeBegin. An attacker caCVE-2025-99126.3Nokia SR Linux is vulnerable to a local privilege escalation vulnerability. Successful exploitation of this vulnerability may allow an autheCVE-2025-99136.1JavaScript can be ran inside the address bar via the dashboard "Open in new Tab" Button, making the application vulnerable to session hijackCVE-2025-99147.5The credentials of the users stored in the system's local database can be used for the log in, making it possible for an attacker to gain unCVE-2025-99188.7A Path Traversal vulnerability in the archive extraction component in Google SecOps SOAR Server (versions 6.3.54.0, 6.3.53.2, and all prior CVE-2025-99199.8A vulnerability was identified in 1000projects Beauty Parlour Management System 1.0. This affects an unknown function of the file /admin/bwdCVE-2025-99207.2A security flaw has been discovered in Campcodes Recruitment Management System 1.0. This impacts the function include of the file /admin/indCVE-2025-99215.4A weakness has been identified in code-projects POS Pharmacy System 1.0. Affected is an unknown function of the file /main/products.php. Thi
CVE-2025-9905: High severity, CVSS 7.3 | Vulnix