Repository navigation
fix(shopware): align Caddy static-asset CSP - #330
Merged
Merged
Conversation
This was referenced Oct 15, 2026
Jonas Elfering (keulinho)
marked this pull request as ready for review
October 15, 2026 11:33
Jonas Elfering (keulinho)
requested review from
Patrick Derks (TrayserCassa) and
Tom Bojer (tombojer)
October 15, 2026 11:52
Tom Bojer (tombojer)
force-pushed
the
codex/static-html-svg-csp
branch
from
October 15, 2026 12:28
c2db182 to
e1e7ca9
Compare
Patrick Derks (TrayserCassa)
approved these changes
Oct 15, 2026
Shadrack Nicholas (shadracnicholas)
approved these changes
Oct 15, 2026
|
Jonas Elfering (@keulinho) Have you considered adding frame-ancestors to the strengthened CSP? Esp. HTML media files may become vulnerable to click jacking, but may break allowed embeds and captured by potential higher/global level configurations. |
Renaud Hager (renaudhager)
approved these changes
Oct 15, 2026
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.
1. Why is this change necessary?
Static assets are served directly by the webserver and do not receive application response policies. HTML and SVG should use a consistent policy, scoped so that application-rendered pages and bundled HTML applications keep their existing behavior.
2. What does this change do, exactly?
Add an existing-file matcher to the Shopware chart's generated Caddyfile for SVG and HTML under
media/andthumbnail/, sendingscript-src 'none'; object-src 'none'; frame-src 'none'; base-uri 'none'; form-action 'none'. This chart supplies its own Caddyfile and therefore needs the same policy as the Docker image. Application-rendered HTML and bundled HTML applications retain their own response policies.Images and styles remain permitted. Custom static documents must work without scripts, embedded documents, base URL overrides or form submissions.
3. Describe each step to reproduce the issue or behaviour.
media/orthumbnail/, and an SVG file.Validation: Rendered the actual template using its helpers and default values in a focused temporary chart; Helm lint passes. Native Caddy validation and 12 real HTTP cases pass. The runtime fixture removes the unrelated tracing block because the test Caddy lacks that module. No complete dependency-chart render or Kubernetes deployment.
4. Please link to the relevant issues (if any).
5. Checklist