Documented Incident · INC-2024-3660 · Critical severity
Keras Arbitrary Code Injection via Malicious Lambda Layers in Legacy Models
CVE-2024-3660 (published April 16, 2024, disclosed by Oligo Security and JFrog) highlighted arbitrary code execution in TensorFlow Keras (`< 2.13`) when deserializing `.h5` or Keras models containing weaponized `Lambda` layers. Because Keras Lambda layers serialize arbitrary marshaled Python bytecode directly inside the neural network graph definition, calling `load_model()` executed attacker commands automatically on load. Legacy enterprise ML pipelines continuing to load third-party H5 models faced silent supply-chain compromise. Upgrading to Keras 2.13+ with `safe_mode=True` enabled by default and scanning model layers remediated the baseline risk.
Incident dossier metadata
- Case ID
INC-2024-3660- Classification
- Incident
- Date
- Severity
- Critical
- Sector
- Cloud & AI Infrastructure
- Attack vector
- Supply Chain
- System type
- TensorFlow / Keras H5 & SavedModel Pipelines
- CVE / reference
CVE-2024-3660- Reference URI
https://nvd.nist.gov/vuln/detail/CVE-2024-3660
Defensive takeaway
Prohibit Keras Lambda layers in third-party model ingestion pipelines, enforce safe_mode=True, and scan all H5/SavedModel artifacts in CI.
Mapped AI security techniques
- Supply Chain Compromise: Model Repository AML.T0010.003
- User Execution: Unsafe AI Artifacts AML.T0011.000
- Manipulate AI Model: Modify AI Model Architecture AML.T0018.001
- Manipulate AI Model: Embed Malware AML.T0018.002
- Publish Poisoned AI Artifacts: Models AML.T0115.001
Mapped defensive controls
- Restrict Library Loading AML.M0011
- Verify AI Artifacts AML.M0014
- Vulnerability Scanning AML.M0016
- Maintain an AI Bill of Materials AML.M0023
Source citation records
- NVD Record CVE-2024-3660: TensorFlow Keras Lambda Layer Arbitrary Code Injection · NIST National Vulnerability Database (NVD) ·