[bug] Fix Path Traversal vulnerability via savefile param

This commit is contained in:
Sergey Konovalov
2020-08-04 18:17:57 +03:00
parent e3f9d145a8
commit 060cb3fda2

View File

@ -1125,6 +1125,7 @@ exports.saveFile = function(req, res) {
}
cmd.setStatusInfo(constants.NO_ERROR);
yield* addRandomKeyTaskCmd(cmd);
cmd.setOutputPath(constants.OUTPUT_NAME + pathModule.extname(cmd.getOutputPath()));
yield storage.putObject(cmd.getSaveKey() + '/' + cmd.getOutputPath(), req.body, req.body.length);
let replyStr = yield* commandSfcCallback(cmd, false, true);
if (replyStr) {