{"id":"GHSA-mmpx-jh39-wrv6","aliases":["GO-2026-5511"],"url":"https://o3.security/vulnerability/GHSA-mmpx-jh39-wrv6","summary":"FileBrowser Vulnerable to Stored XSS via SVG File in Public Share (Missing CSP Header)","details":"## Summary\n\nFileBrowser Quantum serves inline SVG files without a `Content-Security-Policy` header, allowing embedded JavaScript in SVG files to execute when accessed via public share links.\n\nVerified on v1.3.0-stable.\n\n## Affected product\n\n- **Product:** FileBrowser Quantum (`gtsteffaniak/filebrowser`)\n- **Verified version:** v1.3.0-stable\n- **Docker image:** gtstef/filebrowser:latest\n- **Affected endpoint:** `GET /public/api/resources/download?hash=HASH&inline=true`\n- **CWE:** CWE-79 — Cross-site Scripting (Stored)\n\n## Impact\n\n- **Stored XSS** — Malicious SVG persists and executes for every visitor to the share link\n- **No authentication required to trigger** — Public share links are accessible to anyone\n- **Session hijacking** — If authenticated users click the link, their session can be stolen\n- **Phishing** — Attacker can redirect or overlay fake login forms\n\n## Reproduction\n\n1. Login as any user with upload permission\n2. Upload SVG file:\n   ```xml\n   <svg xmlns=\"http://www.w3.org/2000/svg\">\n     <script>alert(document.domain)</script>\n   </svg>\n   ```\n3. Create public share for the file\n4. Access the share link with `?inline=true`\n5. JavaScript executes in browser\n\n## Root cause\n\nThe inline download endpoint returns SVG files with:\n```\nContent-Type: image/svg+xml\nContent-Disposition: inline; filename=\"xss.svg\"\nX-Content-Type-Options: nosniff\n```\n\nBut no CSP header to block script execution. The upstream project (filebrowser/filebrowser) mitigates this with:\n```\nContent-Security-Policy: script-src 'none'\n```\n\n## Suggested fix\n\nAdd CSP header on inline file downloads:\n\n```go\nw.Header().Set(\"Content-Security-Policy\", \"script-src 'none'\")\n```\n\nThis matches the upstream filebrowser/filebrowser implementation.","published":"2026-05-07T03:29:43Z","modified":"2026-06-25T23:11:48.797405Z","cvss":{"score":5.4,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Go","name":"github.com/gtsteffaniak/filebrowser","fixedVersion":"0.0.0-20260501184955-6bfc3974192e"}],"fix":{"url":"https://github.com/gtsteffaniak/filebrowser/commit/6bfc3974192e954f71cc5d1cd04baaaec3b76383","label":"gtsteffaniak/filebrowser@6bfc397"},"references":[{"type":"WEB","url":"https://github.com/gtsteffaniak/filebrowser/security/advisories/GHSA-mmpx-jh39-wrv6"},{"type":"WEB","url":"https://github.com/gtsteffaniak/filebrowser/commit/6bfc3974192e954f71cc5d1cd04baaaec3b76383"},{"type":"PACKAGE","url":"https://github.com/gtsteffaniak/filebrowser"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-06-25T23:11:48.797405Z"}}