{"cve":"CVE-2026-12481","nvd":{"published":"2026-07-03T21:16:54.737","modified":"2026-10-25T15:10:00.147","status":"Analyzed","description":"A vulnerability in keras-team/keras version 3.14.0 allows for arbitrary code execution due to improper handling of deserialization in the `Lambda` layer. Specifically, the `_raise_for_lambda_deserialization()` function fails to enforce the safe-mode guard when `safe_mode` is set to `None`, which is the default value when `from_config()` is called outside of a `SafeModeScope` context. This logic error conflates `None` (unset/default-deny) with `False` (explicitly disabled), bypassing the guard and allowing attacker-controlled `marshal` bytecode to be deserialized. Affected call sites include `keras.layers.deserialize(config)`, `keras.models.clone_model(model)`, and any direct invocation of `Lambda.from_config(config)` without an enclosing `SafeModeScope(True)`. This vulnerability can be exploited to achieve arbitrary OS-level code execution in the context of the server or user process.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8},"cwes":["CWE-502"],"references":["https://huntr.com/bounties/59ceaed1-c8a3-4135-8f94-169ade02823d","https://huntr.com/bounties/59ceaed1-c8a3-4135-8f94-169ade02823d"],"products":["keras:keras"],"source":"nvd","synced_at":"2026-10-25T17:50:06.907763985+00:00"},"epss":{"cve":"CVE-2026-12481","score":0.00719,"percentile":0.53598,"date":"2026-10-25"},"kev":null,"osv":[{"id":"GHSA-5gwj-m78q-7pq3","url":"https://osv.dev/vulnerability/GHSA-5gwj-m78q-7pq3","summary":"Keras: Lambda deserialization can bypass safe mode and execute code","modified":"2026-08-10T11:40:41.687024935Z","packages":[{"ecosystem":"PyPI","name":"keras","purl":"pkg:pypi/keras","ranges":["<3.12.3"],"fixed":["3.12.3"]},{"ecosystem":"PyPI","name":"keras","purl":"pkg:pypi/keras","ranges":[">=3.13.0 <3.15.0"],"fixed":["3.15.0"]}]},{"id":"PYSEC-2026-3631","url":"https://osv.dev/vulnerability/PYSEC-2026-3631","summary":"Keras: Lambda deserialization can bypass safe mode and execute code","modified":"2026-08-10T11:30:11.789165677Z","packages":[{"ecosystem":"PyPI","name":"keras","purl":"pkg:pypi/keras","ranges":["<3.12.3",">=3.13.0 <3.15.0"],"fixed":["3.12.3","3.15.0"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}