Skip to content

Build your personal knowledge base with Trilium Notes

fix(share): one more missing SVG CSP handling

Elian Doranda5669c3a0b7
diff --git a/apps/server/src/share/routes.ts b/apps/server/src/share/routes.ts
index bbd2111e03..84ba0c7c37 100644
--- a/apps/server/src/share/routes.ts
+++ b/apps/server/src/share/routes.ts
@@ -112,7 +112,8 @@ function renderImageAttachment(image: SNote, res: Response, attachmentName: stri
const svg = utils.sanitizeSvg(svgString);
res.set("Content-Type", "image/svg+xml");
res.set("Cache-Control", "no-cache, no-store, must-revalidate");
- res.set("Content-Security-Policy", "script-src 'none'");
+ res.set("Content-Security-Policy", utils.SVG_CONTENT_SECURITY_POLICY);
+ res.set("X-Content-Type-Options", "nosniff");
res.send(svg);
}