keras
Affected
- introduced
3.0.0, fixed3.9.0(ecosystem)
Fixed versions
3.9.0
Fix
- Fixed version
3.9.0pip install --upgrade keras==3.9.0
Advisory
Also known as: CVE-2025-1550, PYSEC-2025-122
Arbitrary Code Execution via Crafted Keras Config for Model Loading
Impact
The Keras Model.load_model function permits arbitrary code execution, even with safe_mode=True, through a manually constructed, malicious .keras archive. By altering the config.json file within the archive, an attacker can specify arbitrary Python modules and functions, along with their arguments, to be loaded and executed during model loading.
Patches
This problem is fixed starting with version 3.9.
Workarounds
Only load models from trusted sources and model archives created with Keras.
References
High Basis: The source's own band: HIGH
3.0.0, fixed 3.9.0 (ecosystem)3.9.0
3.9.0pip install --upgrade keras==3.9.0Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0