Arbitary Code execution in Keras load_model() (Keras-team Keras)
En bref
- Source
- NVD
- EPSS
- EPSS 0.22 % · centile 14 ()
- État
- PUBLISHED
- Publiée
- Mise à jour
- Attribuée par
- Produits affectés
- Keras-team · Keras
- Statut NVD
- Analyzed
Rechercher sur…
Description
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.
Faiblesses (CWE)
- CWE-913 — Contrôle incorrect de ressources de code gérées dynamiquement
Crédits
- Gabriele Digregorio découverte
Références
Scores
| Version | Score | Vecteur | Évalué par |
|---|---|---|---|
| CVSS 4.0 | HIGH 7.3 | CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H | |
| CVSS 4.0 | HIGH 7.3 | CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X | NVD · cve-coordination@google.com (Secondary) |
| CVSS 3.1 | HIGH 7.3 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H | NVD · nvd@nist.gov (Primary) |
Avis
- GHSA-36rr-ww3j-vrjv — The Keras `Model.load_model` method **silently** ignores `safe_mode=True` and allows arbitrary code execution when a `.h5`/`.hdf5` file is loaded.
- PYSEC-2025-123 — The Keras Model.load_model method can be exploited to achieve arbitrary code execution, even with safe_mode=True.
Références européennes
- ENISA EUVD · EUVD-2025-30277
- GCVE · GCVE-0-2025-9905
Avis du CERT-FR
- CERTFR-2026-AVI-1486 — Multiples vulnérabilités dans les produits VMware · cert.ssi.gouv.fr
Configurations affectées (CPE NVD)
cpe:2.3:a:keras:keras:*:*:*:*:*:*:*:*≥ 3.0.0 < 3.11.3
Produits affectés
| Produit | Versions affectées |
|---|---|
Keras-team · Keraskeras | affectée : ≥ 3.0.0 ≤ 3.11.2 Autres versions : non affectée |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST — attribution requested |
| ENISA EUVD | ENISA — reproduction authorised, source acknowledged |
| CERT-FR (ANSSI) | Licence Ouverte / Etalab 2.0 |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain — this product uses data from the NVD API but is not endorsed or certified by the NVD |