Repository navigation
fix(auth): 회전 직후 직전 refresh 토큰 재제출은 세션을 끊지 않는다 (SEC-05) - #371
Merged
Merged
Conversation
prod SEC-05 3건(10/28 17:09, 10/29 09:23·11:08 KST)이 모두 같은 모양이었다. 앱을 열면 만료된 AT 로 요청 여러 개가 401 을 받고, refresh 가 한 번 성공한 뒤 3~8초 뒤에 직전 RT 로 refresh 가 한 번 더 왔다. 서버는 이를 탈취로 보고 family 전체를 폐기해 사용자를 로그아웃시켰다. 회전으로 폐기된 지 30초 안이고 그 회전이 만든 후속 토큰이 모두 살아 있으면 같은 family 에 새 페어를 하나 더 준다. 로그아웃·새 기기 로그인·정지·탈퇴(후속까지 폐기), 후속이 다시 회전된 경우, 30초가 지난 경우는 기존대로 재사용 감지다. 유예는 SEC-05 로 세지 않고 refresh_rotation_grace 로그로 남긴다. 앱 single-flight 는 Android 이슈로 따로 둔다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks
Test Coverage
|
selee1012
added a commit
that referenced
this pull request
Oct 29, 2026
release: SEC-05 refresh 회전 유예 (#371)
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.
왜
prod SEC-05(refresh 재사용 감지) 3건(10/28 17:09, 10/29 09:23·11:08 KST)이 모두 같은 모양이었습니다.
탈취가 아니라 앱의 refresh 경합입니다. 근본 수정은 앱의 single-flight(Android 이슈로 따로 남김)이고, 이 PR 은 서버 쪽 안전망입니다.
무엇을
AuthService.refresh에 회전 유예 30초를 둡니다. 아래를 모두 만족하면 재사용으로 보지 않고 같은 family 에 새 페어를 하나 더 줍니다.parent_token_id)이 있고 모두 살아 있음그래서 다음은 기존과 똑같이 재사용 감지(401 + family 폐기 + SEC-05)입니다.
유예는 SEC-05 로 세지 않고
refresh_rotation_grace userId=… sinceRotationMs=…INFO 로그로 남깁니다.바뀌지 않는 것
parent_token_id인덱스는 이미 있음findByTokenHashForUpdate)은 그대로 — 동시 요청이 직렬화된 뒤 두 번째가 유예로 처리됨테스트
SessionDeviceFlowIT로컬:
auth.*·security.*·observability.*·docs.*통과.🤖 Generated with Claude Code