Open
Conversation
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.
근본 목적
Cross-site 도메인 구조에서 SameSite 쿠키 단독 방어가 불충분한 조건을 기준으로, 현재 Origin/Referer 기반 CSRF 방어가 실제 공격 요청을 차단하고 정상 요청을 통과시키는지 자동화 실험으로 계량 검증한다.
비목적
JWT/Redis JTI 구조 변경, 인증 정책 변경, CSRF 필터 로직 리팩터링은 본 PR 범위에서 제외한다.
변경 요약
docker/security/docker-compose.csrf-matrix.ymldocker/security/env.csrf-matrix.examplescripts/security/csrf-attack-matrix.jsonscripts/security/run-csrf-attack-matrix.shscripts/security/score-csrf-attack-matrix.shdocs/security/csrf-attack-matrix-validation.md검증
정적 검증
bash -n scripts/security/run-csrf-attack-matrix.shbash -n scripts/security/score-csrf-attack-matrix.shjq empty scripts/security/csrf-attack-matrix.json.ai/scripts/verify-purpose-focus.sh docs --staged.ai/scripts/verify-before-commit.sh실행 검증
SCENARIOS=C1 ./scripts/security/run-csrf-attack-matrix.sh./scripts/security/run-csrf-attack-matrix.sh/tmp/syncly-csrf-matrix/results-20260226T113929Z.ndjson/tmp/syncly-csrf-matrix/summary-20260226T113929Z.json실험 수행 및 결과 해석 (서술)
이번 실험은 "공격이 막혔는지"와 "정확히 CSRF 필터가 막았는지"를 분리해서 해석했다. 이유는 현재 체인에서 CORS와 CSRF 필터가 모두 403을 만들 수 있기 때문이다.
Origin/Referer/쿠키조합으로 고정했다.CSRF403여부)를 기록했다.security_block_level: 403 차단 자체를 탐지로 계산csrf_filter_level:CSRF403를 탐지로 계산실측 결과(request level):
이 결과가 의미하는 바:
CSRF403로 명시 차단된 것은 2건(A3, A4)뿐이다.CSRF403코드가 없어서, 실행 관찰상 CORS 단계 차단으로 해석된다.엔지니어링 판정:
관련 이슈