Repository navigation
#610 Add frame-ancestors 'self' to the content security policy - #642
Conversation
frame-ancestors 'self' joins the policy base. The app never set X-Frame-Options, so the class remark and the test header that said it did are corrected. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Review app for PR 642 was deleted |
|
Review-app proof at ce31ba7:
|
E2E tests passed362 passed, 0 failed, 4 skipped in 14 min 26 s Commit |
The directive comment said the app has never sent X-Frame-Options. Our code never set it, but ASP.NET Core's antiforgery adds SAMEORIGIN to every page that renders a token, which the review-app proof shows on the start page. The comment now says so, so a reviewer who curls the app does not read it as wrong. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Closes #610 (part of the OWASP set #607).
frame-ancestorsis the CSP directive that decides which sites may put the service in a frame; it replacedX-Frame-Optionsin current browsers. The policy had no such directive, and the app has never setX-Frame-Options— the middleware's remark said it did, and that is corrected here — so whether a page could be framed depended on whatever sat in front of the app.frame-ancestors 'self'joinsContentSecurityPolicyBaseinSecurityHeadersMiddleware; nothing else in the policy changes ('unsafe-inline'/'unsafe-eval'are Remove 'unsafe-inline' and 'unsafe-eval' from the CSP script-src #611).SecurityHeadersMiddlewareTests.FrameAncestors_AllowsOnlyThisSiteasserts the whole directive, not a substring.X-Frame-Options.Tested: unit 7,479 / 0 (7,478 on main), build 0 errors. Review-app proof in a comment below.
🤖 Generated with Claude Code