PYSEC-2025-122

At a glance

Published
Updated
CVE
CVE-2025-1550
Aliases
GHSA-48g7-3x6r-xfhp
CVSS_V3
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Description

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.

Affected packages

PackageVersions
PyPI · kerasintroduced 3.0.0, fixed 3.8.0

References

Sources

SourceLicence
OSV.devCC-BY 4.0 — PyPA Advisory Database