cve.bz

CVE-2025-9905 keras keras

7.3 highExploit referenceEPSS 0.2%Fix available

High (7.3) in keras keras. EPSS 0.2% estimated probability of exploitation activity in the next 30 days. Fixed in keras 3.11.3.

On this page
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.

Severity

CVSS 4.0

7.3 high
CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

CVSS 3.1

7.3 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
EPSS
0.2% (unchanged from 0.2% a week ago; 0.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 8th percentile. Scored 2026-11-30. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2025-09-20. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-913 Improper Control of Dynamically-Managed Code Resources
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2025-9905 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-9905?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-9905?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2025-9905 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Keras-team Kerasfrom 3.0.0 through 3.11.2

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-36rr-ww3j-vrjvPyPIkeras>=3.0.0 <3.11.33.11.3
PYSEC-2025-123PyPIkeras>=3.0.0 <3.11.33.11.3

Linux distributions

DistributionReleasePackageFixed inAdvisory
Ubuntu18.04:LTS, 20.04:LTSkerasno fix listedUBUNTU-CVE-2025-9905
Azure Linux3keras3.3.3-4AZL-67505

From the distributions' data via OSV.dev: Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Ubuntu.

Red Hat

Red Hat rates this Important.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat OpenShift AI 2.22rhoai/odh-modelmesh-runtime-adapter-rhel9:v2.22.3-1764594508Fixed 2025-12-04RHSA-2025:22759
Red Hat OpenShift AI 2.25rhoai/odh-modelmesh-runtime-adapter-rhel9:v2.25.1-1764825096Fixed 2025-12-17RHSA-2025:23531
Red Hat OpenShift AI (RHOAI)rhoai/odh-modelmesh-runtime-adapter-rhel8Will not fix

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2025-9905.

References

Check your stackJSON