CVE Explorer
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 h
Known exploited
Not asserted
Disputed
No
Stale source
No
Conflicts
0
Affected products and versions
1 source assertion{"collectionURL":"https://github.com/keras-team/keras","defaultStatus":"unaffected","packageName":"keras","product":"Keras","repo":"https://github.com/keras-team/keras","vendor":"Keras-team","versions":[{"lessThanOrEqual":"3.11.2","status":"affected","version":"3.0.0","versionType":"semver"}]}
- cve_program_cvelist_v5affectedurn:baitaphish:normalized-source-record:v2:0478641ca6663620f28e493fa43c29d38d919ed23198e894600a0915ab111f60 · sha256:3f352f50824bbb5c… · /containers/cna/affected/0
Provider-owned CVSS observations
1 source assertion{"metric":{"Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"HIGH","attackRequirements":"PRESENT","attackVector":"LOCAL","baseScore":7.3,"baseSeverity":"HIGH","privilegesRequired":"LOW","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"HIGH","subConfidentialityImpact":"HIGH","subIntegrityImpact":"HIGH","userInteraction":"PASSIVE","valueDensity":"NOT_DEFINED","vectorString":"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","version":"4.0","vulnAvailabilityImpact":"HIGH","vulnConfidentialityImpact":"HIGH","vulnIntegrityImpact":…
- cve_program_cvelist_v5cvssurn:baitaphish:normalized-source-record:v2:0478641ca6663620f28e493fa43c29d38d919ed23198e894600a0915ab111f60 · sha256:3f352f50824bbb5c… · /containers/cna/metrics/0/cvssV4_0
CWE assertions
1 source assertion{"cweId":"CWE-913","description":"CWE-913 Improper Control of Dynamically-Managed Code Resources","lang":"en","type":"CWE"}
- cve_program_cvelist_v5cweurn:baitaphish:normalized-source-record:v2:0478641ca6663620f28e493fa43c29d38d919ed23198e894600a0915ab111f60 · sha256:3f352f50824bbb5c… · /containers/cna/problemTypes/0/descriptions/0
Source references
2 source assertions{"tags":["patch"],"url":"https://github.com/keras-team/keras/pull/21602"}
- cve_program_cvelist_v5referenceurn:baitaphish:normalized-source-record:v2:0478641ca6663620f28e493fa43c29d38d919ed23198e894600a0915ab111f60 · sha256:3f352f50824bbb5c… · /containers/cna/references/0
{"url":"https://github.com/keras-team/keras/security/advisories/GHSA-36rr-ww3j-vrjv"}
- cve_program_cvelist_v5referenceurn:baitaphish:normalized-source-record:v2:0478641ca6663620f28e493fa43c29d38d919ed23198e894600a0915ab111f60 · sha256:3f352f50824bbb5c… · /containers/cna/references/1
Attribution and limitations
- CVE Program CVEList V5: Reproduce the MITRE copyright designation and CVE license in copies. Source →
Provider severity values are preserved separately. Baitaphish does not convert them into a risk rating, infer affected products, or treat EPSS as observed exploitation.