Views
No views yet
model.json Host File Disclosure PoCmodel.json path traversal in weightsManifest.paths.model_dir/model.json sets its weight shard path to ../../tfjs_host_readable_marker.txt. When loaded through the Node filesystem loader, TensorFlow.js joins that path with the model JSON directory and reads the resulting host file without enforcing containment inside the model directory.model_dir/model.json with tf.loadLayersModel("file://.../model.json"), and shows that normal inference output reconstructs the marker bytes exactly.@tensorflow/tfjs: 4.22.0@tensorflow/tfjs-node: 4.22.0loadJSONModel() parses model.json and passes weightsManifest to loadWeights(). The loader then does:1const dirName = dirname(path);
2const weightFilePath = join(dirName, path);
3const buffer = await readFile(weightFilePath);weightFilePath to remain under the model directory.1npm install
2npm run verify1{
2 "hostMarkerOutsideRepo": true,
3 "recoveredFromInferenceOutput": "HOST_FILE_BYTES_VIA_TFJS_JSON_2026",
4 "byteForByteDisclosure": true
5}@tensorflow/tfjs: 4.22.0@tensorflow/tfjs-node: 4.22.0v22.22.20.8.8evidence/; it reports zero issues and skips model.json as unsupported.1ff3ef200d4ec8fc02566b9bdff06ca0f7c3e1d057be5bb75035b45783188ccc8 model_dir/model.json
29a4a8e9e0e016493ee15a72301ed60c2ea74333e9fc9395c03c0460956e8f487 verify_tfjs_host_file_disclosure.jsweightsManifest.paths entry against the model JSON directory and reject absolute paths or parent-relative paths that escape the model directory. The loader should only read weight shards contained inside the model artifact directory unless an explicit, trusted override is configured.