Repository navigation
fix(web): dashboard security hardening (fonts, nginx version, mock worker, Monaco DOMPurify) - #1091
Merged
Merged
Conversation
…naco - Self-host Geist and JetBrains Mono via @fontsource and drop fonts.googleapis.com/fonts.gstatic.com from the page and the CSP, so no third-party stylesheet runs in the dashboard origin (login page included). - nginx: server_tokens off, so the Server header and nginx error pages shown to unauthenticated visitors carry no version (core rule 3). - Production builds no longer ship public/mockServiceWorker.js; only the E2E mock mode (dev server) serves it. - monaco-editor 0.57.0 -> 0.58.0: its bundled DOMPurify goes from 3.4.15 to 3.4.17 (GHSA-6688-9rhm-gjv2, GHSA-c6gr-qvv4-5v3f, GHSA-cg2g-xh64-v4q7, GHSA-mrv2-3pqr-j5jr, GHSA-p98j-92pf-mc4p); the package.json override cannot reach the vendored copy. Markdown hovers also stop loading remote images by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
CI Report - 6728e0brun 45296684924 - attempt 1 0 failed - 11 passed - 22 skipped - 27m33s elapsed Test selection: partial - per-suite table Coverage
Changed
Slowest jobs
e2e buckets run
|
ValgulNecron
marked this pull request as ready for review
November 24, 2026 00:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security review of the web dashboard (SPA, nginx image and config, CSP and headers, token storage, redirects, dependencies). This PR fixes every finding.
Findings
esm/vs/base/browser/dompurify). That version has 5 advisories: GHSA-6688-9rhm-gjv2, GHSA-c6gr-qvv4-5v3f, GHSA-cg2g-xh64-v4q7, GHSA-mrv2-3pqr-j5jr and GHSA-p98j-92pf-mc4p. Theoverridesentry inpackage.jsoncan't reach the bundled copy, andnpm auditdoesn't see it. Monaco'sdomSanitize.jsdoesn't useIN_PLACE,SAFE_FOR_TEMPLATESor XHTML parsing, so I found no way to exploit them here.monaco-editor0.58.0, which bundles 3.4.17. It also stops markdown hovers loading remote images by default.fonts.googleapis.com, and the CSP allowed that host for styles andfonts.gstatic.comfor fonts. Third-party CSS ran in the admin origin with no SRI (Google Fonts CSS can't be pinned). Together withimg-src https:, that is a working CSS exfiltration channel if the CDN or the path to it is compromised. It also told Google about every visit.@fontsource/geistand@fontsource/jetbrains-mono(the same weights the design uses), and both Google hosts are gone fromindex.htmland the CSP.server_tokens on, so theServerheader and nginx's own error pages (404/502) showednginx/1.31.xto unauthenticated visitors. That breaks core rule 3 (no versions before login).server_tokens off./mockServiceWorker.js, the MSW test worker. It is not registered in production, but any script that runs on the origin could register it and keep a service worker that answers the dashboard's own requests, and it would outlive the page.dropMockWorkerVite plugin removes it from non-mock builds. The E2E mock mode runs on the dev server, which still servespublic/.Checked and found sound: sessions use HttpOnly cookies plus a double-submit CSRF header, with no tokens in
localStorage. There are noinnerHTMLordangerouslySetInnerHTMLsinks. Externalhrefs are constants orhttps://-checked (modpack download pages). xterm OSC 8 links are limited to http(s). The SPA has no redirect parameter (no open redirect). The custom CSS and theme-vars sanitizers and the boot-script shape check hold. Share tokens stay out of logs and Referer. The web pod runs non-root with a read-only root filesystem and drops all capabilities. API responses carry their owndefault-src 'none'CSP.npm audit(prod and all) finds 0 vulnerabilities.Verification
npm run buildpasses (tsc and vite). The builtcsp.confno longer lists Google hosts,dist/has nomockServiceWorker.js, and the bundle carries DOMPurify 3.4.17.web/specs.mddocuments the browser hardening.Generated by Claude Code