Keras: Lambda deserialization can bypass safe mode and execute code
CVE-2026-12481 · GHSA-5gwj-m78q-7pq3 · published 2026-07-03 · updated 2026-08-07
- Severity
- High
- CVSS score
- 8.8
- Chance of exploitation (EPSS)
- 0.72%
- Fixed in
- 3.15.0
- Exploitation Public proof of concept
- Automatable No
- Technical impact Total
- CISA SSVC
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 raiseforlambdadeserialization() function fails to enforce the safe-mode guard when safemode is set to None, which is the default value when fromconfig() 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.
Upgrade keras to 3.15.0 or later.
- CriticalLMDeploy has Remote Code Execution by Pickle Deserialization via handle_zmq_recv in lmdeploy/lmdeploy/pytorch/disagg/conn/engine_conn.pylmdeploy
- CriticalLMdeploy has Remote Code Execution by Pickle Deserialization via zmq_rpc.call_and_response() in InterLM/lmdeploylmdeploy
- CriticalSGLang: Unauthenticated RCE via --enable-custom-logit-processorsglang
- CriticalSGLanG: Multimodal scheduler deserializes untrusted pickle data on 0.0.0.0 ROUTER socketsglang
- Criticaln8n: HTTP Request Node Pagination Prototype Pollution to RCEn8n, n8n, n8n
- Criticaln8n Has an XML Node Prototype Pollution Patch Bypassn8n, n8n, n8n
- CriticalKeras framework vulnerable to deserialization of untrusted datakeras
- CriticalKeras code injection vulnerabilitykeras
- HighKeras: TorchModuleWrapper can deserialize unsafe PyTorch pickle datakeras, keras
- HighKeras archive extraction utilities allow path traversal and arbitrary file writeskeras
- HighKeras vulnerable to DoS via Malicious .keras Model (HDF5 Shape Bomb Causes Petabyte Allocation in KerasFileEditor)keras, keras
- HighKeras has an untrusted deserialization vulnerabilitykeras
The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.