Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-9335-keras-hdf5-externallink — CVE-2026-9335: KerasFileEditor and load_weights follow h5py ExternalLinks, disclosing arbitrary local HDF5 file contents in keras ≤ 3.14.0. Advisory + verified PoCs. | Kitploit
Tools/GitHubGitHub/paparojonathan/cve-2026-9335-keras-hdf5-externallink
Vulnerability AnalysisExploitationPapers & ResearchLearning & EducationCurated Resources
GitHubpaparojonathan/cve-2026-9335-keras-hdf5-externallink

CVE-2026-9335-keras-hdf5-externallink

CVE-2026-9335: KerasFileEditor and load_weights follow h5py ExternalLinks, disclosing arbitrary local HDF5 file contents in keras ≤ 3.14.0. Advisory + verified PoCs.

View Repository
4 hours agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-9335 — Keras HDF5 ExternalLink local file-content disclosure

CVE CVSS CWE-22 Affected Fixed

Two public Keras APIs — keras.saving.KerasFileEditor and keras.saving.load_weights / — read HDF5 group members by without a link-type check. h5py / on indexing, so an attacker-supplied , , or file containing only a link causes Keras to read the contents of .

model.load_weights
direct indexing
auto-dereferences
ExternalLink
SoftLink
.weights.h5
.h5
.keras
arbitrary HDF5 files on the victim's local filesystem

Keras already ships the correct guard (safe_get_h5_group / safe_get_h5_dataset in saving_lib.py) — these two entry points simply don't call it.

At a glance

CVECVE-2026-9335
Affectedkeras-team/keras ≤ 3.14.0 (PyPI)
TypePath Traversal / Information Exposure (CWE-22, CWE-200)
CVSS 3.1AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N → 6.5 (Medium)
ImpactDisclosure of any local HDF5 file the victim can read
VectorVictim opens/loads a malicious .weights.h5 / .h5 / .keras file
StatusFixed in keras 3.15.0 (PR #22899 / #22900); validated on huntr (2026-05-22, maintainer hertschuh)
ReporterJonathan Paparo (jonathan-paparo)

Repository contents

PathWhat it is
advisory/CVE-2026-9335.mdFull technical write-up: root cause, both sites, PoC output, fix
poc/poc_file_editor.pyPoC 1 — KerasFileEditor follows an ExternalLink and leaks a victim h5
poc/poc_load_weights.pyPoC 2 — model.load_weights pulls a victim's weights via ExternalLink
poc/requirements.txtPinned reproduction environment
docs/timeline.mdCoordinated-disclosure timeline

Root cause (30 seconds)

root@kitploit:~
# keras/src/saving/saving_api.py  (load_weights, legacy .h5 branch)
with h5py.File(filepath, "r") as f:
    if "layer_names" not in f.attrs and "model_weights" in f:
        f = f["model_weights"]      # <-- ExternalLink here is auto-dereferenced by h5py

f["model_weights"] (and the analogous data[key] walk in file_editor.py) transparently follows a link into another file. The safe pattern that Keras uses elsewhere pre-checks the link type first:

root@kitploit:~
# keras/src/saving/saving_lib.py  (safe_get_h5_group)
group_type = parent.get(name, default=None, getclass=True, getlink=True)
if group_type in (h5py.ExternalLink, h5py.SoftLink):
    raise ValueError(f"Not allowed: H5 file with {group_type.__name__}")

Reproduce

root@kitploit:~
python -m pip install -r poc/requirements.txt

# PoC 1 — KerasFileEditor leaks a separate victim h5 file's contents
KERAS_BACKEND=jax python poc/poc_file_editor.py

# PoC 2 — model.load_weights loads a victim file's weights via an ExternalLink
KERAS_BACKEND=jax python poc/poc_load_weights.py

Each PoC creates its own throwaway "victim" and "attacker" h5 files under the system temp directory, demonstrates the leak, prints *** VULNERABILITY CONFIRMED ***, and cleans up after itself. Verified on keras==3.14.0, Python 3.12.6, JAX backend.

Fix

Route both sites through the existing safe_get_h5_group helper, or add a data.get(key, default=None, getclass=True, getlink=True) pre-check that rejects (h5py.ExternalLink, h5py.SoftLink) before indexing. See the advisory for exact diffs.

Responsible use

This material is published for defensive and educational purposes after coordinated disclosure and CVE assignment. The PoCs operate only on files they create themselves in a temp directory. Do not use these techniques against systems or data you are not authorized to test.

Credit

Discovered and reported by Jonathan Paparo (huntr: jonathan-paparo). Validated by keras-team maintainer hertschuh.

Download Tool