{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/37113?format=json","vulnerability_id":"VCID-dy5p-938j-d7fr","summary":"The Keras Model.load_model method can be exploited to achieve arbitrary code execution, even with safe_mode=True.\n\nOne can create a specially crafted .h5/.hdf5 model archive that, when loaded via Model.load_model, will trigger arbitrary code to be executed.\n\nThis 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.\n\nNote that the .h5/.hdf5 format is a legacy format supported by Keras 3 for backwards compatibility.","aliases":[{"alias":"CVE-2025-9905"},{"alias":"GHSA-36rr-ww3j-vrjv"},{"alias":"PYSEC-2025-123"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/46360?format=json","purl":"pkg:pypi/keras@3.11.3","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.11.3"}],"affected_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/44613?format=json","purl":"pkg:pypi/keras@3.0.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-cmug-fp72-8qc4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"},{"vulnerability":"VCID-ptyp-n4df-aqf1"},{"vulnerability":"VCID-zsjb-zbnj-z3d8"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.0.0"},{"url":"http://public2.vulnerablecode.io/api/packages/44614?format=json","purl":"pkg:pypi/keras@3.0.1","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.0.1"},{"url":"http://public2.vulnerablecode.io/api/packages/44615?format=json","purl":"pkg:pypi/keras@3.0.2","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.0.2"},{"url":"http://public2.vulnerablecode.io/api/packages/44616?format=json","purl":"pkg:pypi/keras@3.0.3","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.0.3"},{"url":"http://public2.vulnerablecode.io/api/packages/44617?format=json","purl":"pkg:pypi/keras@3.0.4","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.0.4"},{"url":"http://public2.vulnerablecode.io/api/packages/44618?format=json","purl":"pkg:pypi/keras@3.0.5","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.0.5"},{"url":"http://public2.vulnerablecode.io/api/packages/44619?format=json","purl":"pkg:pypi/keras@3.1.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.1.0"},{"url":"http://public2.vulnerablecode.io/api/packages/44620?format=json","purl":"pkg:pypi/keras@3.1.1","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.1.1"},{"url":"http://public2.vulnerablecode.io/api/packages/44621?format=json","purl":"pkg:pypi/keras@3.2.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.2.0"},{"url":"http://public2.vulnerablecode.io/api/packages/44622?format=json","purl":"pkg:pypi/keras@3.2.1","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.2.1"},{"url":"http://public2.vulnerablecode.io/api/packages/44623?format=json","purl":"pkg:pypi/keras@3.3.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.3.0"},{"url":"http://public2.vulnerablecode.io/api/packages/44624?format=json","purl":"pkg:pypi/keras@3.3.1","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.3.1"},{"url":"http://public2.vulnerablecode.io/api/packages/44625?format=json","purl":"pkg:pypi/keras@3.3.2","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.3.2"},{"url":"http://public2.vulnerablecode.io/api/packages/44626?format=json","purl":"pkg:pypi/keras@3.3.3","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.3.3"},{"url":"http://public2.vulnerablecode.io/api/packages/44627?format=json","purl":"pkg:pypi/keras@3.4.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.4.0"},{"url":"http://public2.vulnerablecode.io/api/packages/44628?format=json","purl":"pkg:pypi/keras@3.4.1","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.4.1"},{"url":"http://public2.vulnerablecode.io/api/packages/44629?format=json","purl":"pkg:pypi/keras@3.5.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.5.0"},{"url":"http://public2.vulnerablecode.io/api/packages/44630?format=json","purl":"pkg:pypi/keras@3.6.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.6.0"},{"url":"http://public2.vulnerablecode.io/api/packages/44631?format=json","purl":"pkg:pypi/keras@3.7.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-gu8d-jjtb-zuau"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.7.0"},{"url":"http://public2.vulnerablecode.io/api/packages/44632?format=json","purl":"pkg:pypi/keras@3.8.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.8.0"},{"url":"http://public2.vulnerablecode.io/api/packages/46353?format=json","purl":"pkg:pypi/keras@3.9.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.9.0"},{"url":"http://public2.vulnerablecode.io/api/packages/46354?format=json","purl":"pkg:pypi/keras@3.9.1","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.9.1"},{"url":"http://public2.vulnerablecode.io/api/packages/46355?format=json","purl":"pkg:pypi/keras@3.9.2","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.9.2"},{"url":"http://public2.vulnerablecode.io/api/packages/46356?format=json","purl":"pkg:pypi/keras@3.10.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.10.0"},{"url":"http://public2.vulnerablecode.io/api/packages/46357?format=json","purl":"pkg:pypi/keras@3.11.0","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"},{"vulnerability":"VCID-zj76-dr8t-47d2"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.11.0"},{"url":"http://public2.vulnerablecode.io/api/packages/46358?format=json","purl":"pkg:pypi/keras@3.11.1","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.11.1"},{"url":"http://public2.vulnerablecode.io/api/packages/46359?format=json","purl":"pkg:pypi/keras@3.11.2","is_vulnerable":true,"affected_by_vulnerabilities":[{"vulnerability":"VCID-1xj9-1kng-8ua4"},{"vulnerability":"VCID-dy5p-938j-d7fr"}],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:pypi/keras@3.11.2"}],"references":[{"reference_url":"https://github.com/keras-team/keras","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras"},{"reference_url":"https://github.com/keras-team/keras/pull/21602","reference_id":"","reference_type":"","scores":[{"value":"7.3","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H"}],"url":"https://github.com/keras-team/keras/pull/21602"},{"reference_url":"https://github.com/keras-team/keras/security/advisories/GHSA-36rr-ww3j-vrjv","reference_id":"","reference_type":"","scores":[{"value":"7.3","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H"}],"url":"https://github.com/keras-team/keras/security/advisories/GHSA-36rr-ww3j-vrjv"},{"reference_url":"https://nvd.nist.gov/vuln/detail/CVE-2025-9905","reference_id":"CVE-2025-9905","reference_type":"","scores":[],"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-9905"},{"reference_url":"https://github.com/advisories/GHSA-36rr-ww3j-vrjv","reference_id":"GHSA-36rr-ww3j-vrjv","reference_type":"","scores":[],"url":"https://github.com/advisories/GHSA-36rr-ww3j-vrjv"}],"weaknesses":[{"cwe_id":913,"name":"Improper Control of Dynamically-Managed Code Resources","description":"The product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements."},{"cwe_id":937,"name":"OWASP Top Ten 2013 Category A9 - Using Components with Known Vulnerabilities","description":"Weaknesses in this category are related to the A9 category in the OWASP Top Ten 2013."},{"cwe_id":1035,"name":"OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities","description":"Weaknesses in this category are related to the A9 category in the OWASP Top Ten 2017."}],"exploits":[],"severity_range_score":"7.3 - 7.3","exploitability":null,"weighted_severity":null,"risk_score":null,"resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-dy5p-938j-d7fr"}