keras is vulnerable to Denial of Service (DoS)
58
Medium Risk
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.
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.
keras is vulnerable to Denial of Service (DoS) in versions 3.3.0 - 3.12.3 and 3.13.0 - 3.15.0.
Upgrade the keras library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant