Explorar o código

Merge pull request #2688 from weseek/fix/protecting-against-XSS-in-SVG

Fix/protecting against xss in svg
Yuki Takei %!s(int64=5) %!d(string=hai) anos
pai
achega
489f874cf9
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/server/routes/attachment.js

+ 4 - 1
src/server/routes/attachment.js

@@ -228,7 +228,10 @@ module.exports = function(crowi, app) {
     }
     // reference
     else {
-      res.set('Content-Type', attachment.fileFormat);
+      res.set({
+        'Content-Type': attachment.fileFormat,
+        'Content-Security-Policy': "script-src 'unsafe-hashes'",
+      });
     }
   }