Skip to content
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

Ignore: ✨ Controller for updating the principal's expiresAt field #169

Merged
merged 5 commits into from
Oct 10, 2024

Conversation

psychology50
Copy link
Member

@psychology50 psychology50 commented Oct 10, 2024

작업 이유


작업 사항

image

  • Connect 프레임에서 사용자 인증을 수행하지만, API 서버에서 사용자 권한이 만료되었음에도 WebSocket 연결은 가능하다는 문제가 존재함.
  • 이에 PrincipalexpiresAt을 access token 만료 시간으로 설정하여, isAuthenticate 메서드에서 만료 여부를 판단
  • Client가 API 서버에서 refresh를 수행하여 성공하면, 이번에 작업한 path로 principal의 expiresAt 필드를 갱신할 수 있음.
  • 성공 혹은 실패 여부를 클라이언트 측으로 receipt

리뷰어가 중점적으로 확인해야 하는 부분

  • 없음.

발견한 이슈

  • 다 작성하고 생긴 의문. Principal은 client - server 간에 맺어진 헤더를 기반으로 추출함. 그렇다면 클라이언트에서 이 값을 조작할 수 있지 않은가?
    • 일반적인 시나리오에선 Connect 단계에서 검증했기 때문에, 문제가 되지 않음.
    • 만약 토큰을 탈취한 공격자가 한 번이라도 웹 소켓 연결에 성공하면, 이 값을 조작하여 무한 연결을 유지할 우려가 존재함.
  • 따라서, 클라이언트 측에서 헤더를 조작할 수 있는 지 검증 후 대안책을 마련할 필요가 존재함.
  • Ignore: ✨ Custom Socket PreAuthorize AOP & Global Exception Handler #168 에서 구현한 AOP의 치명적인 문제점. 인증/인가를 구분하지 못함.
    • 인증 실패는 클라이언트 측에서 refresh를 시도해야 하지만, 인가 실패는 그렇지 않음. 이에 대해 처리가 필요

@psychology50 psychology50 added the enhancement New feature or request label Oct 10, 2024
@psychology50 psychology50 self-assigned this Oct 10, 2024
@psychology50 psychology50 merged commit 4b73548 into dev Oct 10, 2024
1 check passed
@psychology50 psychology50 deleted the feat/PW-572-principal-refresh-controller branch October 10, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant