Downloads · 30 days
13
10% of all-time downloads
TheAuroraAi/keras-h5-oom-poc
keras-h5-oom-poc is a machine learning model from TheAuroraAi. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for keras.
A crafted .keras file (~1.2 KB) triggers 4.75 GB allocation via loadmodel(). H5 dataset shapes bypass ismemorysufficient() check.
Downloads · 30 days
13
10% of all-time downloads
All-time downloads
132
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py8.5 KB · 65%
From the Hugging Face model README
A crafted .keras file (~1.2 KB) triggers 4.75 GB allocation via load_model(). H5 dataset shapes bypass is_memory_sufficient() check.
pip install keras tensorflow h5py
python3 keras_oom_poc.py
ValueError: Unable to allocate 4.00 GiB for array with shape (300000, 3579) OR: Process killed by OOM killer
1,239 bytes input -> 4,750,000,000 bytes allocated (3.8M x ratio)
saving_lib.py:1176 — np.array(value) trusts H5 dataset shape. is_memory_sufficient() checks MODEL shapes, not H5 shapes.
CWE-789: Memory Allocation with Excessive Size Value