Keras: HDF5 virtual datasets can disclose local files
Keras failed to check whether an HDF5 dataset was virtual, so a crafted model archive could reference external HDF5 files on the victim's filesystem. Loading the model would transparently read those files, potentially disclosing local information.
keras-team/keras
Originally disclosed on huntr
Keras versions up to and including 3.13.2 are vulnerable to an arbitrary HDF5 file read due to an incomplete fix for CVE-2026-1669. The vulnerability resides in the H5IOStore._verify_dataset() and file_editor.py methods, which fail to check the dataset.is_virtual property of HDF5 datasets. This allows an attacker to craft a malicious .keras model archive or .h5 weights file containing a Virtual Dataset (VDS) that references external HDF5 files on the victim's filesystem. When the victim loads the model using keras.models.load_model() or keras.saving.load_model(), the external file is transparently read, leading to potential information disclosure. Fixed in versions 3.12.3 and 3.15.0.
From the GitHub Advisory Database (GHSA-26c4-7vv6-867j, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could cause local HDF5 files to be read when a victim loads a malicious model, potentially disclosing their contents.
What the attacker needed
Victim loads a malicious model file
The fix
It was fixed in versions 3.12.3 and 3.15.0.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A model file can contain links to other files on the computer instead of storing data itself. Keras did not check for these links, so opening a malicious model could make it read files the attacker chose. This is an information leak because the attacker may learn the contents of local files.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.