Skip to content

fix(installer): align static HTML and SVG CSP - #33

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

Jonas Elfering (keulinho) merged 1 commit into
mainfrom
codex/static-html-svg-csp

Conversation

@keulinho

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

Copy link
Copy Markdown
Contributor

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?

Update Resources/install-template/htaccess to mark only existing HTML files under media/ and thumbnail/, and send script-src 'none'; object-src 'none'; frame-src 'none'; base-uri 'none'; form-action 'none'. Apply the same policy to SVG files. Keep the normal PHP rewrite path, bundled HTML applications and application-rendered HTML unchanged.

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.

  1. Serve an existing HTML file under media/ or thumbnail/, and an SVG file.
  2. Check the response for the full CSP above.
  3. Open a bundled HTML application or an application-rendered page; its response policy should retain its existing behavior.

Validation: Apache syntax and 15 real HTTP cases pass against this actual template, including subdirectory installation, uppercase extensions, SVG, query strings, bundled HTML and fixture PHP responses. Local Docker HTTP tests; no full installer run.

4. Please link to the relevant issues (if any).

5. Checklist

  • I have tested the changed configuration
  • I have checked that rendered HTML and bundled HTML applications retain their behavior
  • I have checked whitespace and syntax where applicable
  • Complete repository CI before merging

@shyim

Copy link
Copy Markdown
Member

we can skip this, the recipes will win

@keulinho
Jonas Elfering (keulinho) marked this pull request as ready for review October 15, 2026 11:26
@keulinho
Jonas Elfering (keulinho) merged commit 7ba8aef into main Oct 16, 2026
12 checks passed
@keulinho
Jonas Elfering (keulinho) deleted the codex/static-html-svg-csp branch October 16, 2026 07:05
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.

2 participants