Skip to content

fix(report): scan pages with a strict CSP or Trusted Types (0.18.3) - #47

Merged
DuncanFaulkner merged 2 commits into
mainfrom
fix/report-bypass-csp
Oct 15, 2026
Merged

DuncanFaulkner merged 2 commits into
mainfrom
fix/report-bypass-csp

Conversation

@DuncanFaulkner

Copy link
Copy Markdown
Contributor

Report mode injects its scan as an inline script plus a style tag. A page with a strict Content-Security-Policy (e.g. script-src 'self') or Trusted Types (require-trusted-types-for 'script') blocked both, so every route came back as an error with no findings. Two real sites hit this: OpenProject's community site (CSP header) and nx-ng-starter (meta-tag CSP with Trusted Types).

The scanning browser context now sets Playwright's bypassCSP: true, which covers header and <meta> policies and Trusted Types. The app's own policy is unchanged. The CHANGELOG notes that the scan runs without the policy, so problems caused by the policy itself aren't reported.

  • New E2E tests: a page with a strict CSP header and one with the same policy in a meta tag. Both fail without the fix.
  • 433/433 tests, typecheck clean. Both real sites now scan with no page errors.
  • CHANGELOG 0.18.3, version bump

@DuncanFaulkner
DuncanFaulkner merged commit a47c4d0 into main Oct 15, 2026
1 check passed
@DuncanFaulkner
DuncanFaulkner deleted the fix/report-bypass-csp branch October 15, 2026 22:00
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