Explorar el Código

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

Fix/protecting against xss in svg
Yuki Takei hace 5 años
padre
commit
489f874cf9
Se han modificado 1 ficheros con 4 adiciones y 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'",
+      });
     }
   }