Skip to content

fix(social): 댓글·좋아요 접근 제어, 신고 API 접근 제어에 오늘 공유 조건 추가#173

Merged
coldsunn merged 2 commits into
developfrom
fix/past-report-access-check
Jun 1, 2026
Merged

fix(social): 댓글·좋아요 접근 제어, 신고 API 접근 제어에 오늘 공유 조건 추가#173
coldsunn merged 2 commits into
developfrom
fix/past-report-access-check

Conversation

@coldsunn
Copy link
Copy Markdown
Collaborator

@coldsunn coldsunn commented May 31, 2026

📝 요약(Summary)

문제

  1. 기존 access check가 isShared=true만 검사해 친구가 어제 공유 후 끄지 않은 리포트는 dailyReportId 추측만으로 댓글·좋아요 진입이 가능하던 문제(웹에서는 URL에 dailyReportId가 노출되므로)
  2. 신고 API에 access check가 없어 dailyReportId/commentId 추측만으로 임의 사용자 신고가 가능하던 어뷰징 경로 차단. 비밀 댓글은 본문 열람 권한자만 신고 가능하도록 체크하는 로직 부재

구현

  • existsByIdAndIsSharedTrue → existsByIdAndIsSharedTrueAndDate 변경

  • 호출처 5곳에 today 조건 적용:
    · CommentQueryService.checkCommentViewAccess
    · CommentCommandService.checkCommentWriteAccess
    · LikeQueryService.checkCommentViewAccess
    · LikeCommandService.checkReportLikeAccess, checkCommentLikeAccess

  • 본인 리포트는 early return 유지 — 본인의 과거·비공유 글 댓글창 접근 보장

  • ContentReportCommandService.checkReportAccess 헬퍼 신설: 본인 글 early return, 그 외 오늘 공유된 친구 리포트만 신고 가능

  • 비밀 댓글 신고 시 추가 권한 체크 (리포트 소유자 또는 부모 댓글 작성자만 가능)
    · 자기 신고 방지가 위에서 작성자 본인을 차단하므로 실질 권한자는 owner·parentAuthor

  • ModerationController Swagger 403 응답 명세 추가

🔗 Related Issue

  • Closes:

💬 공유사항

✅ PR Checklist

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • PR 제목을 커밋 메시지 컨벤션에 맞게 작성했습니다.

coldsunn added 2 commits June 1, 2026 01:42
기존 access check가 isShared=true만 검사해 친구가 어제 공유 후 끄지 않은 리포트는 dailyReportId 추측만으로 댓글·좋아요 진입이 가능하던 문제
해결, existsByIdAndIsSharedTrue → existsByIdAndIsSharedTrueAndDate 변경하고 메서드 쓰인 곳 모두 변경
ContentReportCommandService.checkReportAccess 메서드로 본인 글 early return, 그 외 오늘 공유된 친구 리포트만 신고 가능 권한
체크, 비밀 댓글 신고 시 추가 권한 체크, Swagger 403 응답 명세 추가
@1Seob
Copy link
Copy Markdown
Collaborator

1Seob commented Jun 1, 2026

머지 고고

@coldsunn coldsunn merged commit bb7a726 into develop Jun 1, 2026
1 check passed
@coldsunn coldsunn deleted the fix/past-report-access-check branch June 1, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants