This repository is a benign security proof-of-concept for Protect AI ModelScan.
It demonstrates that ModelScan 0.8.8 flags direct TensorFlow ReadFile and
WriteFile ops as high severity, but misses equivalent file read/write behavior
when it is carried through TensorFlow Dataset ops inside a SavedModel.
verify_poc.py reads TFSM_TEXTLINE_DATASET_MARKER_2026 through TextLineDataset.
verify_poc.py writes TFSM_DATASET_TO_TFRECORD_MARKER_2026 through DatasetToTFRecord.
ModelScan reports total_issues: 0 for artifacts/savedmodel_dataset_io.
Expected control behavior:
The direct control contains ReadFile and WriteFile.
ModelScan reports two high-severity issues for controls/savedmodel_direct_file_io_control.
Impact
This is not a TensorFlow vulnerability. TensorFlow SavedModels are executable
graphs and file I/O behavior is expected when a graph contains filesystem ops.
The issue is a scanner false negative: ModelScan supports SavedModel scanning and
already classifies direct file I/O ops as high severity, but it does not flag
Dataset-based filesystem ops that can read controlled local files and write
controlled local outputs during normal SavedModel execution.
Additional hashes are in evidence/final_sha256sums.txt.
Mitigation
ModelScan's SavedModel unsafe-op policy should include Dataset filesystem ops
that can read or write host paths, including at least TextLineDataset,
FixedLengthRecordDatasetV2, DatasetToTFRecord, and SaveDataset. Scanner
tests should include direct ReadFile / WriteFile controls and dataset-backed
equivalents.