CVE-2025-9905
Publiée le 2025-09-19 · Dernière modification le 2026-10-19
Les applications utilisant Keras pour charger des fichiers de modèle hérités aux formats `.h5` ou `.hdf5` sont concernées, car le paramètre `safe_mode=True` est ignoré pour ces formats. Un attaquant peut exécuter du code arbitraire sur votre système en vous incitant à charger un fichier de modèle spécialement conçu. Cela nécessite que l'attaquant vous amène d'abord à télécharger et charger manuellement son fichier malveillant, ce qui en fait une attaque de complexité élevée reposant sur l'interaction de l'utilisateur.
DÉTAIL DU VECTEUR CVSS
RÉFÉRENCES
Description officielle du NVD (en anglais)
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.