Repository navigation
[Fix#6] JWT 키 검증·비밀번호 오류·로그인 시도 제한 - #8
Merged
Merged
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.
Summary
JWT 기본키로 서버가 실행되거나, BCrypt가 72바이트 이후의 입력을 무시해 다른 비밀번호를 인증하거나, 로그인 실패 요청을 제한 없이 반복할 수 있는 문제를 수정했습니다.
서버 실행 시 JWT 키를 검증하고, 비밀번호 한계 초과 입력은 400으로 거부하며, 계정·IP별 로그인 제한은 429와
Retry-After로 안내합니다.Tasks
spring-security-crypto는 6.3.10입니다.PasswordEncoder도 초과 입력의 해시 생성과 인증을 막습니다.CF-Connecting-IP를 사용합니다. 임의 전달 헤더로 제한을 우회하지 못하도록 처리했습니다.Verification
mvn -B -ntp verify가 통과했다 (33개 테스트, 실패·오류·스킵 없음)mvn -B -ntp verify가 통과했다 (33개 테스트)/v3/api-docs응답을 테스트로 확인했습니다To Reviewer
로그인 제한은 단일 프로세스 메모리에서 관리하므로 재시작하면 초기화됩니다. 추적 항목 수에는 상한이 있고, 한도 초과 시 기존 제한을 삭제하지 않고 새 항목에 429를 반환합니다. 여러 인스턴스로 확장할 때는 공유 저장소가 필요합니다.
#7에서 Cloudflare Tunnel을 연결할 때 백엔드 직접 접근을 차단하고 실제 프록시 연결 IP만
LOGIN_TRUSTED_PROXY_ADDRESSES에 지정해야 사용자별 IP 제한이 적용됩니다. 배포 서버에는 별도 무작위JWT_SECRET을 설정해야 합니다.