Răsfoiți Sursa

Merge pull request #3196 from weseek/fix/regex-#2

fix regex reference
Yuki Takei 5 ani în urmă
părinte
comite
ace4e821d5

+ 1 - 1
src/server/routes/admin.js

@@ -325,7 +325,7 @@ module.exports = function(crowi, app) {
 
 
   api.validators.export.download = function() {
   api.validators.export.download = function() {
     const validator = [
     const validator = [
-      // https://regex101.com/r/mD4eZs/4
+      // https://regex101.com/r/mD4eZs/6
       // prevent from pass traversal attack
       // prevent from pass traversal attack
       param('fileName').not().matches(/(\.\.\/|\.\.\\)/),
       param('fileName').not().matches(/(\.\.\/|\.\.\\)/),
     ];
     ];

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

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

+ 1 - 1
src/server/service/import.js

@@ -369,7 +369,7 @@ class ImportService {
 
 
     unzipStream.on('entry', (entry) => {
     unzipStream.on('entry', (entry) => {
       const fileName = entry.path;
       const fileName = entry.path;
-      // https://regex101.com/r/mD4eZs/4
+      // https://regex101.com/r/mD4eZs/6
       // prevent from unexpecting attack doing unzip file (path traversal attack)
       // prevent from unexpecting attack doing unzip file (path traversal attack)
       // FOR EXAMPLE
       // FOR EXAMPLE
       // ../../src/server/views/admin/markdown.html
       // ../../src/server/views/admin/markdown.html