{"id":"UBUNTU-CVE-2026-12481","details":"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.","modified":"2026-07-09T21:30:36.762644175Z","published":"2026-07-03T21:16:00Z","upstream":["CVE-2026-12481"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2026-12481"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2026-12481"},{"type":"REPORT","url":"https://huntr.com/bounties/59ceaed1-c8a3-4135-8f94-169ade02823d"}],"affected":[{"package":{"name":"keras","ecosystem":"Ubuntu:18.04:LTS","purl":"pkg:deb/ubuntu/keras?arch=source&distro=bionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0.7-2","2.1.1-1"],"ecosystem_specific":{"binaries":[{"binary_name":"python3-keras","binary_version":"2.1.1-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-12481.json"}},{"package":{"name":"keras","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/keras?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.2.4-1"],"ecosystem_specific":{"binaries":[{"binary_version":"2.2.4-1","binary_name":"python3-keras"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-12481.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"},{"type":"Ubuntu","score":"medium"}]}