Advisory

PYSEC-2025-122

Also known as: CVE-2025-1550, GHSA-48g7-3x6r-xfhp

Summary

The record has no summary.

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.

Severity

Critical Basis: CVSS v3 score 9.8, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Dates

Published
2025-03-11 09:15 UTC
Modified
2026-06-10 17:01 UTC

Affected packages and fixes

keras

PyPI · All systems

Affected

  • introduced 3.0.0, fixed 3.8.0 (ecosystem)

Fixed versions

3.8.0

Fix

  • Fixed version 3.8.0
    pip install --upgrade keras==3.8.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: PyPA Advisory Database · CC BY 4.0

Sources & licences