1. Archivio CVE
  2. 2025
  3. CVE-2025-9905

CVE-2025-9905

7.3 Gravità alta CVSS v3.1 · fonte NVD CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H 7.3 – Alta

Descrizione

The Keras Model.load_model method can be exploited to achieve arbitrary code execution, even with safe_mode=True. One can create a specially crafted .h5/.hdf5 model archive that, when loaded via Model.load_model, will trigger arbitrary code to be executed. This is achieved by crafting a special .h5 archive file that uses the Lambda layer feature of keras which allows arbitrary Python code in the form of pickled code. The vulnerability comes from the fact that the safe_mode=True option is not honored when reading .h5 archives. Note that the .h5/.hdf5 format is a legacy format supported by Keras 3 for backwards compatibility.

Prodotti coinvolti

FornitoreProdottoVersionePiattaforma
keras keras >= 3.0.0 < 3.11.3 –
Tutte le 15 vulnerabilità di Keras

Tipo di vulnerabilità

CWE-913 Improper Control of Dynamically-Managed Code Resources

The product does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements.

Impatto sui sistemi

AmbitoImpatto
Integrità Eseguire codice o comandi non autorizzati
Altro, Integrità Dipende dal contesto, Alterare la logica di esecuzione

Come si previene

Sviluppo · Validazione dell’input For any externally-influenced input, check the input against an allowlist of acceptable values.
Sviluppo · Architettura e progettazione · Refactoring Refactor the code so that it does not need to be dynamically managed.

Le indicazioni di mitigazione sono riportate nella lingua originale del catalogo CWE del MITRE.

Tutte le 101 CVE di tipo CWE-913, con andamento e prevenzione

Fonte: catalogo CWE del MITRE · cwe.mitre.org