Downloads · 30 days
0
MarcOrtiz21/tensorflow-savedmodel-pbtxt-modelscan-bypass-poc
tensorflow-savedmodel-pbtxt-modelscan-bypass-poc is a machine learning model from MarcOrtiz21. 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 tf-keras. The card lists the license as apache-2.0.
Security research PoC for responsible disclosure through Huntr's Model File Vulnerability program.
Downloads · 30 days
0
Access
Public
Updated May 21, 2026
Repo size
8.2 KB
Likes
0
Public
Click a slice to open those files.
.pbtxt40.3 KB · 72%
From the Hugging Face model README
Security research PoC for responsible disclosure through Huntr's Model File Vulnerability program.
This repository demonstrates a scanner differential for TensorFlow SavedModel:
saved_model.pb and saved_model.pbtxt.0.8.8 detects unsafe TensorFlow ops in saved_model.pb.saved_model.pbtxt is skipped as unsupported.tf.saved_model.load() still loads the pbtxt model and executes the exported signature.The payload is benign. The generated model reads /tmp/huntr_savedmodel_pbtxt_secret.txt, returns its contents from the model signature, and writes /tmp/huntr_savedmodel_pbtxt_marker.txt.
3.12.13tensorflow==2.21.0modelscan==0.8.8python -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
python reproduce.py
To regenerate the checked-in artifact:
python reproduce.py --keep-artifact artifact
Expected scanner behavior:
binary_savedmodel/: ModelScan reports ReadFile and WriteFile.pbtxt_savedmodel/: ModelScan reports 0 issues and skips saved_model.pbtxt.Expected load behavior:
pbtxt_savedmodel/.codex-local-proof./tmp/huntr_savedmodel_pbtxt_marker.txt.The checked-in artifact/ directory contains:
binary_savedmodel/: control model with saved_model.pb.pbtxt_savedmodel/: bypass model with saved_model.pbtxt and no saved_model.pb.Pipelines that rely on ModelScan before loading untrusted TensorFlow SavedModels can miss the same unsafe graph when it is represented as TensorFlow's text protobuf variant. The issue is not TensorFlow's support for pbtxt; the issue is treating one canonical loader-accepted representation as outside scanner scope.