Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Ducksss
marked this pull request as draft
September 1, 2026 18:14
Owner
Author
|
Closing after critical review: this draft does not provide the observable rollout it claims. The report-only policy defines neither |
5 of 6 tasks
Ducksss
added a commit
that referenced
this pull request
Oct 1, 2026
main has enforced a Content-Security-Policy since #554. This hardens it and gives it the feedback loop a backend-free site can have. - script-src-attr 'none' refuses inline event-handler attributes, the injection path that 'unsafe-inline' otherwise leaves open. React never renders them: all 318 prerendered routes contain none. - frame-src 'self' drops six unused third-party embed origins. Only the same-origin component and template previews frame, and the Embed Basic catalog demo is a faux player. - https://www.google-analytics.com is dropped; *.google-analytics.com already covers it. - Script elements keep 'unsafe-inline'. Next streams build-specific inline RSC scripts into every static page (1,028 distinct hashes across 318 routes, 999 of them on a single route, changing with each deploy), and nonces would force dynamic rendering. JSON-LD data blocks are not policed by script-src. - The policy stays enforced rather than report-only. With no collector, report-only output would only reach visitors' consoles (see #546). tests/e2e/content-security-policy.e2e.spec.ts fails on any violation across the landing page, docs, catalog, both preview frames, templates, blog and case study, with consent declined and accepted. It also checks the served header on documents and preview frames. - The int spec pins every directive exactly, plus the dev-only eval and Vercel debug allowances and the origin derived from NEXT_PUBLIC_POSTHOG_HOST. - The stale CSP paragraph in docs/ai-discovery is refreshed, and AGENTS.md gains a gotcha for adding third-party origins. Refs #521 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ducksss
added a commit
that referenced
this pull request
Oct 1, 2026
#584) * config(fix): tighten the enforced CSP and browser-test it on every run main has enforced a Content-Security-Policy since #554. This hardens it and gives it the feedback loop a backend-free site can have. - script-src-attr 'none' refuses inline event-handler attributes, the injection path that 'unsafe-inline' otherwise leaves open. React never renders them: all 318 prerendered routes contain none. - frame-src 'self' drops six unused third-party embed origins. Only the same-origin component and template previews frame, and the Embed Basic catalog demo is a faux player. - https://www.google-analytics.com is dropped; *.google-analytics.com already covers it. - Script elements keep 'unsafe-inline'. Next streams build-specific inline RSC scripts into every static page (1,028 distinct hashes across 318 routes, 999 of them on a single route, changing with each deploy), and nonces would force dynamic rendering. JSON-LD data blocks are not policed by script-src. - The policy stays enforced rather than report-only. With no collector, report-only output would only reach visitors' consoles (see #546). tests/e2e/content-security-policy.e2e.spec.ts fails on any violation across the landing page, docs, catalog, both preview frames, templates, blog and case study, with consent declined and accepted. It also checks the served header on documents and preview frames. - The int spec pins every directive exactly, plus the dev-only eval and Vercel debug allowances and the origin derived from NEXT_PUBLIC_POSTHOG_HOST. - The stale CSP paragraph in docs/ai-discovery is refreshed, and AGENTS.md gains a gotcha for adding third-party origins. Refs #521 Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(fix): mount GA4 offline in the CSP walk now that the tag is host-gated GA4 now mounts on the production hosts only (#586), so on localhost accepting consent no longer attaches script#google-tag, and the Accept walk in content-security-policy.e2e.spec.ts fails at its toBeAttached check. watchPolicy now opts the host back in through mountGoogleTagOffline, which stubs every Google origin before it sets the test hook. The Decline walk keeps the hook too, so it also proves that declining mounts nothing on an allowed host. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch was successfully deployed
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.
Summary
Content-Security-Policy-Report-Onlyheader as the first rollout stageframe-ancestorsandframe-srcAddresses #521. Add
Closes #521to the nextdev→mainpromote PR after production reports have been reviewed.Validation
pnpm exec vitest run tests/int/fumadocs-site.int.spec.tspnpm exec prettier --check next.config.mjs tests/int/fumadocs-site.int.spec.tspnpm build/returned the full report-only CSP headergit diff --check