Skip to content

[FIX] SMS 인증 API 보안 개선 - 전화번호를 Request Body로 이동 #77

@DDINGJOO

Description

@DDINGJOO

문제점

현재 SMS 인증 API에서 전화번호를 URL Path Parameter로 전달하고 있음.

현재 엔드포인트

POST /api/v1/auth/sms/{userId}/{phoneNumber}
GET  /api/v1/auth/sms/{userId}/{phoneNumber}?code={code}
PUT  /api/v1/auth/sms/{userId}/{phoneNumber}

보안 위험

  • 서버 액세스 로그에 전화번호 기록
  • 브라우저 히스토리에 노출
  • 프록시/로드밸런서 로그에 기록
  • Referrer 헤더로 유출 가능

해결 방안

민감한 정보(전화번호)를 Request Body로 전달하도록 변경.

변경 후 엔드포인트

POST /api/v1/auth/sms/request
Body: { "userId": "xxx", "phoneNumber": "01012345678" }

POST /api/v1/auth/sms/verify
Body: { "userId": "xxx", "phoneNumber": "01012345678", "code": "123456" }

POST /api/v1/auth/sms/resend
Body: { "userId": "xxx", "phoneNumber": "01012345678" }

작업 내용

  • SMS 인증용 DTO 클래스 생성
    • SmsCodeRequest (인증 코드 요청/재발신)
    • SmsVerifyRequest (인증 확인)
  • SmsConfirmController Request Body 방식으로 수정
  • Swagger 문서 업데이트
  • 테스트 실행 및 검증

참고

OWASP API Security Top 10 - Sensitive Data Exposure 관련 이슈

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions