Views
No views yet
@tensorflow/tfjs-node reads arbitrary host files.
A model is a model.json plus weight files named in weightsManifest[].paths. The Node filesystem
loader resolves each weight path with join(modelDir, path) and readFiles it, with no containment
check — so weight paths containing ../ escape the model directory.npm install @tensorflow/tfjs-nodeunzip poc.zip (gives model.json with weightsManifest path ../../../../../../../../etc/hostname, and poc.js)node poc.js model.json/etc/hostname (a file outside the model dir).tf.loadLayersModel('file://.../model.json'), tf.loadGraphModel(...), tf.io.fileSystem(...).load().tfjs-node/src/io/file_system.ts loadWeights():
const weightFilePath = join(dirName, path); const buffer = await readFile(weightFilePath);
No ../absolute rejection, no normalize, no startsWith(dir) containment.../absolute paths.@tensorflow/tfjs-node; no huntr report; web search found no matching advisory.