Skip to content

Let renderDocument pages run under the default oshp CSP (refs #287) - #295

Merged
jimhoyd merged 2 commits into
mainfrom
fix/ui-document-strict-csp-287
Sep 20, 2026
Merged

jimhoyd merged 2 commits into
mainfrom
fix/ui-document-strict-csp-287

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Refs #287 (does not close it).

Reproduction: the kit path (createKit, ui extension) already links a hashed stylesheet and sends its own nonce CSP, which wins over the oshp profile. Only renderDocument emits an un-nonced inline <style>, which oshp (default-src 'self') blocks. Confirmed from the code and the existing 'existing headers win' behavior; not exercised in a real browser.

Change: optional style: {nonce} on renderDocument, new documentContentSecurityPolicy(nonce), tests, docs (packages/ui README, docs/policies/security.md, changelog). oshp is unchanged and no unsafe-inline is added. Without the option the output is identical.

Open decision recorded in docs/OPEN-DECISIONS.md: whether renderDocument should eventually link a served hashed stylesheet instead.

Verification: npm ci, npm run verify (pass), npm run docs:llms, npm run check:docs.

🤖 Generated with Claude Code

jimhoyd and others added 2 commits September 20, 2026 10:57
Add style nonce option and documentContentSecurityPolicy; document the
interaction and record the longer-term decision.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@jimhoyd
jimhoyd force-pushed the fix/ui-document-strict-csp-287 branch from 3fb01d9 to 4ae1175 Compare September 20, 2026 15:59
@jimhoyd
jimhoyd enabled auto-merge (squash) September 20, 2026 15:59
@jimhoyd
jimhoyd merged commit 1e55896 into main Sep 20, 2026
20 checks passed
@jimhoyd
jimhoyd deleted the fix/ui-document-strict-csp-287 branch September 20, 2026 16:06
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.

1 participant