Aller au contenu
ModelPrésentéExterne
Télécharger

Tensorflowjs Unused Optimizer Weightspecs Poc

This repository contains a benign security research proof of concept for a TensorFlow.js model.json that appends a very large number of zero-length optimizer weight specs.

TypeOtherVersionRevision 6174f00DClasse

Source du modèle

Type
Other
Taille du fichier
8 B
Version
vRevision 6174f00
Mis à jour
20 oct. 2026
Téléchargements
0
Source
Hugging Face

Description de la source

TensorFlow.js optimizer weightSpecs amplification PoC

This repository contains a benign security research proof of concept for a TensorFlow.js model.json that appends a very large number of zero-length optimizer weight specs.

Files

  • model.json - TF.js layers-model file with extra optimizer-group weight specs
  • weights.bin - tiny 8-byte control weights buffer
  • build-meta.json - entry count and artifact sizes
  • package.json - minimal dependency on @tensorflow/tfjs 4.22.0
  • reproduce_from_files.js - local replay helper

What it demonstrates

loadLayersModel() decodes the full weightSpecs list before deciding whether optimizer weights are relevant.

With 1000000 zero-length optimizer specs:

  • model.json is about 68.56 MB
  • local replay drives about 1.3 GB RSS
  • the model still loads successfully

Quick repro

npm ci
node --expose-gc reproduce_from_files.js .

Expected output shape:

{
  "entries": 1000000,
  "json_mb": 68.56,
  "ms": 2876,
  "rss_before": 554.7,
  "rss_after": 1313.7,
  "pred": [[1.975830834697992e-43]]
}

This PoC is intended for defensive validation and bug bounty triage only.

Sources

1 source
Hugging FacePrincipalVersion 6174f005207c1df9dac4bdabfc30f0f714b5fb0e
huggingface.co/hacnho/tensorflowjs-unused-optimizer-weightspecs-poc/tree/6174f005207c1df9dac4bdabfc30f0f714b5fb0e

Vérifié 8 août

Artefacts du modèle

1 artefact

weights.bin

bin · 8 B · SHA-256 cec62291c7d5…1e28 · Hugging Face

Télécharger

Extraits de sources

2 extraits

--- tags: - security - proof-of-concept - tensorflowjs - tfjs - dos license: mit --- # TensorFlow.js optimizer weightSpecs amplification PoC This repository contains a benign security research proof of concept for a TensorFlow.js `model.json` that appends a very large number of zero-length optimizer weight specs. ## Files - `model.json` - TF.js layers-model file with extra optimizer-group weight specs - `weights.bin` - tiny 8-byte control weights buffer - `build-meta.json` - entry count and artifact sizes - `package.json` - minimal dependency on `@tensorflow/tfjs 4.22.0` - `reproduce_from_files.js` - local replay helper ## What it demonstrates `loadLayersModel()` decodes the full `weightSpecs` list before deciding whether optimizer weights are relevant. With `1000000` zero-length optimizer specs: - `model.json` is about `68.56 MB` - local replay drives about `1.3 GB` RSS - the model still loads successfully ## Quick repro ```bash npm ci node --expose-gc reproduce_from_files.js . ``` Expected output shape: ```json { "entries": 1000000, "json_mb": 68.56, "ms": 2876, "rss_before": 554.7, "rss_after": 1313.7, "pred": [[1.975830834697992e-43]] } ``` This PoC is intended for defensive validation and bug bounty triage only.

Source context: 0 downloads · 0 likes · Repo hacnho/tensorflowjs-unused-optimizer-weightspecs-poc