{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/37114?format=json","vulnerability_id":"VCID-64yr-ww4w-ckdr","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 .keras model archive that, when loaded via Model.load_model, will trigger arbitrary code to be executed. This is achieved by crafting a special config.json (a file within the .keras archive) that will invoke keras.config.enable_unsafe_deserialization() to disable safe mode. Once safe mode is disable, one can use the Lambda layer feature of keras, which allows arbitrary Python code in the form of pickled code. Both can appear in the same archive. Simply the keras.config.enable_unsafe_deserialization() needs to appear first in the archive and the Lambda with arbitrary code needs to be second.","aliases":[{"alias":"CVE-2025-9906"},{"alias":"GHSA-36fq-jgmw-4r9c"},{"alias":"PYSEC-2025-76"}],"fixed_packages":[{"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"}],"affected_packages":[],"references":[{"reference_url":"https://github.com/keras-team/keras/commit/713172ab56b864e59e2aa79b1a51b0e728bba858","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras/commit/713172ab56b864e59e2aa79b1a51b0e728bba858"},{"reference_url":"https://github.com/keras-team/keras/pull/21429","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/21429"},{"reference_url":"https://github.com/keras-team/keras/releases/tag/v3.11.0","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/keras-team/keras/releases/tag/v3.11.0"},{"reference_url":"https://github.com/pypa/advisory-database/tree/main/vulns/keras/PYSEC-2025-76.yaml","reference_id":"","reference_type":"","scores":[],"url":"https://github.com/pypa/advisory-database/tree/main/vulns/keras/PYSEC-2025-76.yaml"},{"reference_url":"https://nvd.nist.gov/vuln/detail/CVE-2025-9906","reference_id":"CVE-2025-9906","reference_type":"","scores":[],"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-9906"},{"reference_url":"https://osv.dev/vulnerability/CVE-2025-9906","reference_id":"CVE-2025-9906","reference_type":"","scores":[],"url":"https://osv.dev/vulnerability/CVE-2025-9906"},{"reference_url":"https://github.com/advisories/GHSA-36fq-jgmw-4r9c","reference_id":"GHSA-36fq-jgmw-4r9c","reference_type":"","scores":[],"url":"https://github.com/advisories/GHSA-36fq-jgmw-4r9c"}],"weaknesses":[{"cwe_id":502,"name":"Deserialization of Untrusted Data","description":"The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid."},{"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-64yr-ww4w-ckdr"}