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

Inspect INC-2024-3660 in Interactive Incidents & Cases Hub

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

Mapped defensive controls

Source citation records