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

Check it before you install it

One call answers whether to add this package: known advisories, CISA KEV, and whether the name is a hallucinated or freshly squatted one. No key needed to try it.

curl -s https://vdb.ai.kr/v1/ai/check-packages \
  -H 'Content-Type: application/json' \
  -d '{"packages":["pkg:pypi/keras"]}'