Advisory

GHSA-48g7-3x6r-xfhp

Also known as: CVE-2025-1550, PYSEC-2025-122

Summary

Arbitrary Code Execution via Crafted Keras Config for Model Loading

Details

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

  • https://www.cve.org/cverecord?id=CVE-2025-1550
  • https://github.com/keras-team/keras/pull/20751

Severity

High Basis: The source's own band: HIGH

Dates

Published
2025-03-11 20:07 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

keras

PyPI · All systems

Affected

  • introduced 3.0.0, fixed 3.9.0 (ecosystem)

Fixed versions

3.9.0

Fix

  • Fixed version 3.9.0
    pip install --upgrade keras==3.9.0

Fix 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

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences