Skip to content

docs(security): document stored asset CSP and CDN requirements - #2613

Merged
Jonas Elfering (keulinho) merged 6 commits into
mainfrom
codex/static-html-svg-csp
Oct 16, 2026
Merged

Jonas Elfering (keulinho) merged 6 commits into
mainfrom
codex/static-html-svg-csp

Conversation

@keulinho

@keulinho Jonas Elfering (keulinho) commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Document CSP protection for stored HTML and SVG in the Apache, Nginx and Caddy examples. Application-rendered pages and bundled HTML applications retain their existing behavior.

Add a dedicated XSS on stored assets section to the security reference. Explain why application CSP does not protect independently served assets, link to the webserver configuration pages, and require manual response-header configuration when a dedicated CDN serves assets from a different CDN URL. For reverse proxies, explain that the origin CSP must be preserved, including cached responses, and that Shopware's default Fastly and Varnish configurations already do so. Existing installations must update and deploy their webserver configurations. The reverse-cache guide remains unchanged; no VCL snippets or new proxy policies are documented.

Related links

Checklist

  • I reviewed affected links, code samples, and cross-references, including PageRef references where relevant.
  • No pages were moved, renamed, or deleted; no redirects are needed.
  • Spelling checks pass without wordlist additions.
  • Any required dependent changes in downstream modules have already been merged and published.
  • This pull request is ready for review.

Notes

Markdown lint passes for the server examples; spelling and link checks pass for the security reference. The Apache example contains the policy directly in its existing virtual-host block, using a header expression for existing media/thumbnail HTML. The extracted combined example passes Apache syntax validation and 12 HTTP cases with a fixture PHP front controller; missing HTML media also retains the application's policy. Earlier validation of the unchanged Caddy/Nginx config blocks passed native checks and 25 HTTP cases. Origin CSP propagation was verified against the existing Varnish configs and adapted Fastly snippets locally. No full documentation-site build or live Fastly validation was performed. Keep this draft until the linked webserver configuration changes are available.

@shopware-dev-docs-connector

shopware-dev-docs-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Developer Docs healthcheck

Status: Completed with success.
Repository: shopware/docs
Commit: e072c53
Preview: https://developer-documentation-d0xlc0pnd-shopware-frontends.vercel.app
Workflow run: #5661

@keulinho Jonas Elfering (keulinho) changed the title docs(hosting): align static HTML and SVG CSP examples docs(security): document stored asset CSP and CDN requirements Oct 15, 2026
@keulinho
Jonas Elfering (keulinho) marked this pull request as ready for review October 16, 2026 07:04
Copilot AI balanced review requested due to automatic review settings October 16, 2026 07:04
@keulinho
Jonas Elfering (keulinho) merged commit 19ae8ec into main Oct 16, 2026
8 checks passed
@keulinho
Jonas Elfering (keulinho) deleted the codex/static-html-svg-csp branch October 16, 2026 07:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The linked core change remains unmerged, so release coordination requires human confirmation before approval.

1 open finding
What changed in this PR

Documents stored-asset CSP protection in Shopware’s server examples and security reference, while preserving application-rendered page behavior.

Changes:

  • Strengthens CSP for stored HTML and SVG across Apache, Nginx and Caddy.
  • Explains CDN header configuration, reverse-proxy preservation and deployment requirements.
File Description
resources/​references/​security.md Adds stored-asset XSS protection and deployment guidance
resources/​references/​config-reference/​server/​nginx.md Adds stored HTML protection and updates SVG handling
resources/​references/​config-reference/​server/​caddy.md Extends CSP matching to existing stored documents
resources/​references/​config-reference/​server/​apache.md Adds HTML and SVG CSP rules

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


This policy blocks scripts, embedded documents, base URL overrides and form submissions while permitting images and styles. It must be present on the asset response, including when a cache serves the file.

The provided [Apache](./config-reference/server/apache.md), [Nginx](./config-reference/server/nginx.md) and [Caddy](./config-reference/server/caddy.md) configurations include CSP protection for stored HTML and SVG. Update and deploy existing configurations to receive these protections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants