-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/Member Id 주입 방식 변경 #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "feat/MemberId-\uC8FC\uC785-\uBC29\uC2DD-\uBCC0\uACBD"
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,20 +39,6 @@ public Object resolveArgument(MethodParameter parameter, | |
| log.info("HttpServletRequest is null"); | ||
| throw new MemberNotFoundException("사용자 정보를 찾을 수 없습니다."); | ||
| } | ||
|
|
||
| String token = resolveToken(request); | ||
| if (token == null || !jwtTokenProvider.validateToken(token)) { | ||
| throw new MemberNotFoundException("사용자 정보를 찾을 수 없습니다."); | ||
| } | ||
|
|
||
| return jwtTokenProvider.getMemberId(token); | ||
| } | ||
|
|
||
| private String resolveToken(HttpServletRequest request) { | ||
| String bearerToken = request.getHeader("Authorization"); | ||
| if (bearerToken != null && bearerToken.startsWith("Bearer ")) { | ||
| return bearerToken.substring(7); | ||
| } | ||
| return null; | ||
| return Long.parseLong(request.getHeader("X-Member-Id")); | ||
|
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
문제점: JWT 기반 인증을 제거하고 단순히 X-Member-Id 헤더 값을 신뢰하는 것은 심각한 보안 취약점입니다. 클라이언트가 임의의 Member ID를 헤더에 설정하여 다른 사용자로 위장할 수 있습니다.
영향:
수정 제안:
만약 마이크로서비스 아키텍처에서 API Gateway가 JWT 검증 후 X-Member-Id 헤더를 추가하는 방식이라면, 다음과 같은 보안 조치가 필요합니다: