VDB
Sign up
CRITICAL9.8

PYSEC-2025-122

Quick fix

PYSEC-2025-122 — keras: upgrade to the fixed version with the command below.

pip install --upgrade 'keras>=3.8.0'

Details

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.

Are you affected?

Enter the version of the package you're using.

Affected packages

PyPI/keras
Introduced in: 3.0.0Fixed in: 3.8.0
Fixpip install --upgrade 'keras>=3.8.0'

References