Intel

AIKIDO-2026-408481

keras is vulnerable to Denial of Service (DoS)

Denial of Service (DoS) Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 3 days ago

58

Medium Risk

This Affects:

PYTHONkeras
3.3.0 - 3.12.3
Fixed in 3.12.4
3.13.0 - 3.15.0
Fixed in 3.15.1
Are you affected? Scan for Free

TL;DR

Affected versions of keras guard .keras archives against decompression bombs only on the in-memory reads of config.json, model.weights.h5, and the sharded weight map. When an archive has more than three members, keras.saving.load_model builds a disk-backed DiskIOStore that extracts every ZIP member with ZipFile.extractall, with path-traversal filtering but no per-member decompression-ratio check. An attacker-added member that decompresses far beyond its stored size can therefore write hundreds of MB to GB to disk from a small archive under the default safe_mode=True, exhausting disk space and denying service. The fix adds _reject_zip_extract_bomb, which rejects members whose declared-to-stored size ratio exceeds the threshold before extraction.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you load .keras model archives that contain assets from untrusted sources.

Background info

keras is vulnerable to Denial of Service (DoS) in versions 3.3.0 - 3.12.3 and 3.13.0 - 3.15.0.

How to fix this

Upgrade the keras library to the patch version.