Browse Source

fix delete file validator

zamis 5 years ago
parent
commit
e5caa3326f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/server/routes/apiv3/export.js

+ 2 - 2
src/server/routes/apiv3/export.js

@@ -62,9 +62,9 @@ module.exports = (crowi) => {
 
   const validator = {
     deleteFile: [
-      // https://regex101.com/r/mD4eZs/3
+      // https://regex101.com/r/mD4eZs/4
       // prevent from unexpecting attack doing delete file (path traversal attack)
-      param('fileName').not().matches(/(\.\.\/|\.\.\\)/g),
+      param('fileName').not().matches(/(\.\.\/|\.\.\\)/),
     ],
   };