Security/member access and file ownership - #65
Open
wonjongin wants to merge 2 commits into
Open
Conversation
타인의 학번·전화번호·이메일 등 개인정보 노출 방지를 위해
GET /members/{memberId} 조회를 본인 번호로만 제한하고, 불일치 시 403 반환
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
파일 소유권 검증 없이 key만 알면 임의 삭제가 가능하던 문제를 방지하기 위해 DELETE /files 권한을 ADMIN으로 제한 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dvin-22
reviewed
Jul 11, 2026
Comment on lines
+45
to
+46
| // 파일 삭제 (임의 삭제 방지를 위해 관리자만 허용) | ||
| @PreAuthorize("hasRole('ADMIN')") |
Member
There was a problem hiding this comment.
게시물 삭제, 파일 목록에서 파일 삭제 권한(COUNCIL, PRESIDENT, ADMIN)과 동일하게 맞추어야 COUNCIL, PRESIDENT 권한 유저가 게시물을 삭제했을 때 오류가 안 뜰 것 같아요
| }) | ||
| ResponseEntity<SuccessResponse<?>> getOtherMemberInfo(@PathVariable("memberId") Long memberId); | ||
| ResponseEntity<SuccessResponse<?>> getOtherMemberInfo(Long authMemberId, | ||
| @PathVariable("memberId") Long memberId); |
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.
#️⃣ 연관된 이슈
📝 작업 내용
GET /api/v1/members/{memberId})를 본인 번호로만 조회 가능하도록 제한했습니다. 타인의 학번·전화번호·이메일 등 개인정보가 노출되던 문제를 방지하고, 본인이 아닌 회원 조회 시 403을 반환합니다.DELETE /api/v1/files) 권한을 관리자(ADMIN)로 제한했습니다. 파일 소유권 검증 없이 S3 key만 알면 누구나 파일을 삭제할 수 있던 문제를 방지합니다.📢 참고 사항