Downloads · 30 days
0
ericblackgachara/tfjs-fill-ops-dos-poc
tfjs-fill-ops-dos-poc is a machine learning model from ericblackgachara. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
tf.loadGraphModel() + model.predict() executes a Fill op whose dims parameter is an attacker-controlled Const tensor. The Fill op allocates output based on the dims value without bounds checking total allocation size.
Downloads · 30 days
0
Access
Public
Updated May 9, 2026
Repo size
146 KB
Likes
0
Public
Click a slice to open those files.
.pdf146 KB · 88%
From the Hugging Face model README
tf.loadGraphModel() + model.predict() executes a Fill op whose dims parameter is an attacker-controlled Const tensor. The Fill op allocates output based on the dims value without bounds checking total allocation size.
8 bytes of weight data → 2 GB allocation → OOM crash
| Detail | Value |
|---|---|
| Package | @tensorflow/tfjs 4.22.0 |
| CWE | CWE-789: Memory Allocation with Excessive Size Value |
| CVSS | 7.5 High (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) |
| Amplification | 268,435,456x |
| File | Purpose |
|---|---|
| demo_dos_tfjs_final.js | Self-contained Node.js PoC — builds model in memory, serves via HTTP, loads, executes, confirms 2 GB allocation. No external files needed. |
| craft_malicious_tfjs.js | Optional — writes model.json + weights.bin to disk for manual inspection |
npm install @tensorflow/tfjs
node demo_dos_tfjs_final.js
That's it — single command. The script:
tf.loadGraphModel()model.predict() which triggers the Fill opConst(dims) → Const(value) → Fill → Identityint32(536870912) + float32(0.0)model.predict() executes the Fill op, which calls tf.fill([536870912], 0.0)