Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public record GetUserProfileResponse(
Double height,
Double weight,
ExerciseType exerciseType,
LocalDate birthDate
LocalDate birthDate,
String email

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

사용자 프로필 조회 응답에 이메일이 추가되었습니다. 이메일은 개인정보에 해당하므로 API 응답에 포함될 때 주의가 필요합니다.

GetUserProfileResponse DTO가 오직 인증된 사용자 본인의 정보를 조회하는 경우에만 사용된다면 문제가 없지만, 만약 다른 사용자의 프로필을 조회하는 데에도 사용된다면 개인정보가 노출될 수 있는 보안 취약점이 될 수 있습니다.

이 응답이 다른 사용자에게 노출될 가능성이 있다면, 이메일 필드를 제거하거나 다른 사용자를 위한 별도의 공개용 프로필 DTO를 만드는 것을 고려해 주세요. 예를 들어, GetPublicUserProfileResponse 와 같이 민감한 정보를 제외한 DTO를 분리하는 것이 좋은 방법이 될 수 있습니다.

) {
// User와 온보딩 정보로 프로필 조회 응답 DTO를 생성합니다.
public static GetUserProfileResponse of(User user, UserOnboarding userOnboarding) {
Expand All @@ -39,7 +40,8 @@ public static GetUserProfileResponse of(User user, UserOnboarding userOnboarding
user.getHeight(),
user.getWeight(),
exerciseType,
user.getBirthDate()
user.getBirthDate(),
user.getEmail()
);
}
}