Skip to main content
HIGH

CVE-2025-9905

CVSS v3

7.3

HIGH

EPSS Score

0.2 %

exploit probability, as of 2026-10-17

CISA KEV

No

known exploited

Exploitation

—

SSVC status

Get an alert for each new CVE published for keras. Watch keras in CVE Watch Free account · no credit card

Affected and fixed versions

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • kerasPyPIfrom 3.0.0 · fixed in 3.11.3

Vendor advisories

  • CVE-2025-9905 Red Hat Product Security3 products fixed · 1 known affected

    keras: Arbitary Code execution in Keras load_model()

    rhoai/odh-modelmesh-runtime-adapter-rhel8 as a component of Red Hat OpenShift AI (RHOAI)

  • RHSA-2025:23531 Red Hat Product Security2 products fixed

    Red Hat Security Advisory: RHOAI 2.25.1 - Red Hat OpenShift AI

  • RHSA-2025:22759 Red Hat Product Security1 product fixed

    Red Hat Security Advisory: RHOAI 2.22.3 - Red Hat OpenShift AI

Full record on NVD

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.

Technical details

Published
2025-09-19

Frequently asked questions

What is CVE-2025-9905?

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.

Is CVE-2025-9905 actively exploited?

Active exploitation of CVE-2025-9905 has not been confirmed. Its EPSS score was 0.2% on 2026-10-17, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2025-9905?

CVE-2025-9905 has a CVSS v3 base score of 7.3 (HIGH severity).

Running keras? Hear about its next vulnerability

CVE Watch matches each new CVE to the vendors and products you list (vendor and product, not the version) and puts it in your alerts with its KEV and EPSS status.

Already have an account? Open CVE WatchNo credit card required · 50 free checks/month · Free API key