Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review: add XSS protection headers for SVG icon serving

Adam Eivy2a47701c194d
diff --git a/server/routes/apps.js b/server/routes/apps.js
index ebc02f3714..5863fc0bb2 100644
--- a/server/routes/apps.js
+++ b/server/routes/apps.js
@@ -210,6 +210,11 @@ router.get('/:id/icon', loadApp, asyncHandler(async (req, res) => {
res.set('Content-Type', contentType);
res.set('Cache-Control', 'public, max-age=3600');
res.set('ETag', etag);
+ res.set('X-Content-Type-Options', 'nosniff');
+ if (contentType === 'image/svg+xml') {
+ res.set('Content-Disposition', 'inline; filename="icon.svg"');
+ res.set('Content-Security-Policy', "default-src 'none'; style-src 'unsafe-inline'");
+ }
const ifNoneMatch = req.headers['if-none-match'];
if (ifNoneMatch) {