fix(csp): add explicit manifest-src 'self' directive#961
Merged
nesquena-hermes merged 1 commit intonesquena:masterfrom Apr 24, 2026
Merged
fix(csp): add explicit manifest-src 'self' directive#961nesquena-hermes merged 1 commit intonesquena:masterfrom
nesquena-hermes merged 1 commit intonesquena:masterfrom
Conversation
86b6721 to
c0eac44
Compare
PR nesquena#920 added static/manifest.json and sw.js for PWA support. The CSP in _security_headers() had no explicit manifest-src directive, so browsers fell back to default-src 'self' and emitted a console warning on every page load. The fallback is functionally correct but non-compliant with CSP Level 3 best practice of declaring each directive explicitly. Adds manifest-src 'self' before base-uri. No origin set is changed. Regression test added alongside existing CSP coverage in test_pwa_manifest_csp.py. Co-authored with Claude Sonnet 4.6 / Anthropic.
c0eac44 to
30b4ca6
Compare
nesquena-hermes
added a commit
that referenced
this pull request
Apr 24, 2026
Co-authored-by: nesquena-hermes <[email protected]>
nesquena-hermes
added a commit
that referenced
this pull request
Apr 24, 2026
Co-authored-by: nesquena-hermes <[email protected]>
JKJameson
pushed a commit
to JKJameson/hermes-webui
that referenced
this pull request
Apr 25, 2026
Co-authored-by: nesquena-hermes <[email protected]>
JKJameson
pushed a commit
to JKJameson/hermes-webui
that referenced
this pull request
Apr 25, 2026
PR nesquena#920 added static/manifest.json and sw.js for PWA support. The CSP in _security_headers() had no explicit manifest-src directive, so browsers fell back to default-src 'self' and emitted a console warning on every page load. The fallback is functionally correct but non-compliant with CSP Level 3 best practice of declaring each directive explicitly. Adds manifest-src 'self' before base-uri. No origin set is changed. Regression test added alongside existing CSP coverage in test_pwa_manifest_csp.py. Co-authored with Claude Sonnet 4.6 / Anthropic.
JKJameson
pushed a commit
to JKJameson/hermes-webui
that referenced
this pull request
Apr 25, 2026
Co-authored-by: nesquena-hermes <[email protected]>
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.
Hermes WebUI now serves a PWA manifest (
static/manifest.json) and service worker added in PR #920, but the Content-Security-Policy in_security_headers()has no explicitmanifest-srcdirective. Browsers fall back todefault-src 'self'per the spec, which is functionally correct, but omitting the directive generates a console warning on every page load and leaves the PWA policy implicit rather than declared.What changed: One line added to
api/helpers.py—manifest-src 'self'inserted beforebase-uri. No origin set is changed; this is a declaration-only fix.Verification: 3 regression tests added in
tests/test_pwa_manifest_csp.pyasserting the directive is present and that all existing directives are unchanged. Run withpytest tests/test_pwa_manifest_csp.py -v.Risk: Limited to the CSP header string. No logic, routing, or auth changes.
Co-authored with Claude Sonnet 4.6 / Anthropic.