Skip to content
Path traversal Disclosed report Intermediate CVE-2026-12479

Keras: DiskIOStore permits path traversal through crafted layer names

The DiskIOStore.make method in Keras 3.14.0 builds directory paths from user-supplied layer names without blocking parent-directory sequences. An attacker could craft a malicious Keras model that, when saved or loaded, writes files or creates directories outside the intended temporary working directory.

keras-team/keras

Originally disclosed on huntr

A path traversal vulnerability exists in keras-team/keras version 3.14.0, specifically in the DiskIOStore.make method within the Keras 3 model saving and loading library. This vulnerability arises from the improper handling of user-provided layer names, which are used to construct directory paths without sanitizing for parent directory components (..). While forward slashes (/) are restricted in layer names, directory traversal sequences are not. This allows an attacker to craft a malicious Keras model that, when saved or loaded, can escape the intended temporary working directory and perform unauthorized file system operations, such as creating directories or writing files in arbitrary locations.

From the GitHub Advisory Database (GHSA-gh82-f9x8-5frx, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

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

Root cause

Likely the layer name is joined into a filesystem path without rejecting parent-directory components, so '..' segments escape the intended working directory.

Impact

An attacker could create directories or write files in arbitrary locations on the filesystem, limited to what the Keras process is permitted to access.

What the attacker needed

Crafted Keras model file; victim saves or loads the model

The fix

Layer names should be sanitised to reject parent-directory components before being used in filesystem paths.

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.

When a program saves a model, it uses the layer names to make folder names. If a name contains '..', which means 'go up one folder', the program can be tricked into writing outside its own folder. This is called path traversal, and it lets someone put files in places they should not reach.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More from keras-team/keras

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.