{"id":"GHSA-3mjm-x6gw-2x42","aliases":["GHSA-3mjm-x6gw-2x42"],"related":[],"kind":"vulnerability","state":"published","title":"@grackle-ai/server has Missing Content-Security-Policy and X-Frame-Options Headers","summary":"### Impact\n\nThe HTTP server does not set `Content-Security-Policy`, `X-Frame-Options`, or `X-Content-Type-Options` headers on any response. This reduces defense-in-depth against XSS, clickjacking, and MIME-sniffing attacks.\n\nWhile the current XSS attack surface is small (React-markdown is configured safely, no `dangerouslySetInnerHTML`, Vite does not generate source maps), the absence of these headers means any future XSS vulnerability would have no secondary defense layer.\n\n**Affected code:**\n- `packages/server/src/index.ts` — all `res.writeHead()` calls only set `Content-Type`, with no security headers\n\n### Patches\n\n0.70.4\n\n**Fix:** Add security headers to all HTML/API responses:\n```typescript\nres.writeHead(200, {\n  \"Content-Type\": contentType,\n  \"Content-Security-Policy\": \"default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:\",\n  \"X-Frame-Options\": \"DENY\",\n  \"X-Content-Type-Options\": \"nosniff\"\n});\n```\n\n### Workarounds\n\nUse a reverse proxy (nginx, Caddy) in front of the Grackle server to inject security headers.\n\n### References\n\n- CWE-693: Protection Mechanism Failure\n- OWASP: HTTP Security Response Headers\n- File: `packages/server/src/index.ts`","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"### Impact\n\nThe HTTP server does not set `Content-Security-Policy`, `X-Frame-Options`, or `X-Content-Type-Options` headers on any response. This reduces defense-in-depth against XSS, clickjacking, and MIME-sniffing attacks.\n\nWhile the current XSS attack surface is small (React-markdown is configured safely, no `dangerouslySetInnerHTML`, Vite does not generate source maps), the absence of these headers means any future XSS vulnerability would have no secondary defense layer.\n\n**Affected code:**\n- `packages/server/src/index.ts` — all `res.writeHead()` calls only set `Content-Type`, with no security headers\n\n### Patches\n\n0.70.4\n\n**Fix:** Add security headers to all HTML/API responses:\n```typescript\nres.writeHead(200, {\n  \"Content-Type\": contentType,\n  \"Content-Security-Policy\": \"default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:\",\n  \"X-Frame-Options\": \"DENY\",\n  \"X-Content-Type-Options\": \"nosniff\"\n});\n```\n\n### Workarounds\n\nUse a reverse proxy (nginx, Caddy) in front of the Grackle server to inject security headers.\n\n### References\n\n- CWE-693: Protection Mechanism Failure\n- OWASP: HTTP Security Response Headers\n- File: `packages/server/src/index.ts`","format":"markdown","source":"ghsa"}],"published":"2026-03-25T17:32:04.000Z","modified":"2026-03-25T17:46:27.723Z","severity":{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"}],"cwes":["CWE-79","CWE-693"],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.70.4"}],"ecosystem":"npm","package":"@grackle-ai/server","purl":"pkg:npm/%40grackle-ai/server","source":"ghsa"}],"references":[{"url":"https://github.com/nick-pape/grackle/security/advisories/GHSA-3mjm-x6gw-2x42","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/nick-pape/grackle","tags":["package"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3mjm-x6gw-2x42","url":"https://github.com/advisories/GHSA-3mjm-x6gw-2x42","licence":"CC-BY-4.0","modified":"2026-03-25T17:46:27.723Z"}],"updatedAt":"2026-11-25T22:56:43.836Z"}