Incident report

Keras Model.load_model() safe_mode=True Bypass via Crafted config.json

CVE-2025-1550 (published March 11, 2025) revealed an arbitrary code execution bypass in Keras's `Model.load_model()` even when `safe_mode=True` was explicitly enforced. Attackers could modify the `config.json` manifest inside a `.keras` zip archive to reference arbitrary Python modules and callable functions resolved during object deserialization. Because `.keras` archives are exchanged widely across research repos and model hubs under the assumption that `safe_mode=True` blocks executable payloads, loading unvetted models compromised host environments. Keras maintainers patched module-resolution restrictions and hardened safe-mode allowlists.

Incident record

Reported
Severity
Critical
Vector
Supply Chain
Affected system type
Keras / TensorFlow Model Loading Pipelines
Reference
CVE-2025-1550
Reference URI
https://nvd.nist.gov/vuln/detail/CVE-2025-1550

Inspect in Interactive Incidents Hub

Defensive lesson

Upgrade Keras past CVE-2025-1550, inspect model archive config manifests before loading, and isolate untrusted model imports in ephemeral sandboxes.

Referenced techniques