fix(security): reject unsafe frame-ancestor configuration - #382
Open
seonghobae wants to merge 4 commits into
Open
fix(security): reject unsafe frame-ancestor configuration#382seonghobae wants to merge 4 commits into
seonghobae wants to merge 4 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesCSP 설정 검증
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
seonghobae
marked this pull request as ready for review
August 11, 2026 09:40
seonghobae
enabled auto-merge (squash)
August 11, 2026 19:43
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.
Objective
Fail closed when the server-owned
viewer.security.frame-ancestorsconfiguration contains CSP directive delimiters or HTTP control characters. Protected main currently concatenates the configured value directly into theContent-Security-Policyheader, so a malformed value such ashttps://trusted.example; script-src *can inject an unintended CSP directive and an embedded line break can cross the response-header safety boundary.Test-first state
This Draft starts intentionally RED at exact test-only head
f827aaed03460204a38caf928cfcbba366006750, directly based on protectedmain55d7ae8647208e301f282350f076eeddaba61d11.ViewerSecurityHeadersWebFilterTest.rejectsFrameAncestorDirectiveAndHeaderInjectionrequires constructor-time rejection of both a semicolon directive injection and an embedded newline/header injection. Protected main accepts both values, so the focused regression must fail before the production repair.Scope
ViewerSecurityHeadersWebFilterconfiguration validation and its focused regression only. This does not change the normal'self'default, valid custom frame-ancestor source lists, viewer routing, PDF.js worker policy, auth, persistence, Office conversion, or repository governance. PR #306 carries historical broad ancestry that includes this filter but does not own this new current-base security invariant; its eventual stale-descendant reconciliation must preserve the protected-main result rather than overwrite it.Acceptance
Observe exact-head RED -> add the smallest fail-closed character-boundary validation -> exact-head
mvn -B --no-transfer-progress verifywith zero missed owned production lines/branches and warning-free public Javadocs -> CI/Security Scan/SAST/fuzz where emitted -> current review/thread/live-base refetch. Keep Draft until the unchanged exact head is GREEN. Independent write-authorized approval remains a separate protected-merge gate.Summary by CodeRabbit
frame-ancestors설정값에 세미콜론이나 제어 문자가 포함될 경우 설정 오류를 명확히 감지합니다.