Skip to content

[hotfix] 구글 로그인 연동 문제 해결#49

Merged
seoahS01 merged 1 commit into
mainfrom
hotfix/48-googlelogin
Feb 12, 2026
Merged

[hotfix] 구글 로그인 연동 문제 해결#49
seoahS01 merged 1 commit into
mainfrom
hotfix/48-googlelogin

Conversation

@seoahS01
Copy link
Copy Markdown
Contributor

#️⃣ 연관된 이슈

관련된 이슈 번호를 적어주세요. 예: #이슈번호

#48

#️⃣ 작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요. (이미지 첨부 가능)

구글 로그인 연동 문제 해결

#️⃣ 테스트 결과

코드 변경에 대해 테스트를 수행한 결과를 요약해주세요. 예: 모든 테스트 통과 여부, 새로 작성한 테스트 케이스 등

스크린샷 2026-02-12 오후 3 54 45

#️⃣ 변경 사항 체크리스트

  • 코드에 영향이 있는 모든 부분에 대한 테스트를 작성하고 실행했나요?
  • 문서를 작성하거나 수정했나요? (필요한 경우)
  • 코드 컨벤션에 따라 코드를 작성했나요?
  • 본 PR에서 발생할 수 있는 모든 의존성 문제가 해결되었나요?

#️⃣ 스크린샷 (선택)

관련된 스크린샷이 있다면 여기에 첨부해주세요.

#️⃣ 리뷰 요구사항 (선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요.
예시: 이 부분의 코드가 잘 작동하는지 테스트해 주실 수 있나요?

📎 참고 자료 (선택)

관련 문서, 스크린샷, 또는 예시 등이 있다면 여기에 첨부해주세요

@seoahS01 seoahS01 self-assigned this Feb 12, 2026
@seoahS01 seoahS01 added the 🐞BugFix Something isn't working label Feb 12, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @seoahS01, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 Google 로그인 연동 문제를 해결하기 위해 Google OAuth 콜백 엔드포인트를 업데이트하고, OAuth 프로세스 중 리다이렉트 URL을 처리하는 방식을 개선합니다. 특히, 리다이렉트 URL이 state 파라미터에서 안전하게 디코딩되도록 하여 로그인 흐름의 안정성을 높였습니다.

Highlights

  • Google OAuth 콜백 엔드포인트 업데이트: Google OAuth 콜백 엔드포인트의 경로가 /oauth/google/callback에서 /v1/oauth/google/callback으로 변경되어 API 버전 관리가 적용되었습니다.
  • 리다이렉트 URL 처리 로직 개선: OauthServiceloginWithGoogle 메서드에서 리다이렉트 URL을 직접 파라미터로 받는 대신, state 파라미터에서 URL을 디코딩하여 사용하도록 수정되었습니다. 이는 리다이렉트 URL이 올바르게 전달되고 처리되도록 보장합니다.
  • URL 디코딩 유틸리티 추가: URL 디코딩을 위해 UriUtilsStandardCharsets 클래스가 OauthService에 임포트되었습니다.
Changelog
  • src/main/java/net/studioxai/studioxBe/domain/auth/controller/OauthController.java
    • Google OAuth 콜백 엔드포인트 경로가 /v1/oauth/google/callback으로 변경되었습니다.
  • src/main/java/net/studioxai/studioxBe/domain/auth/service/OauthService.java
    • UriUtilsStandardCharsets 클래스가 임포트되었습니다.
    • loginWithGoogle 메서드의 redirectUrl 파라미터가 state로 변경되었고, state 파라미터에서 리다이렉트 URL을 디코딩하여 사용하도록 수정되었습니다.
Activity
  • seoahS01님이 PR을 생성했습니다.
  • 이 PR은 이슈 #48과 연관되어 있습니다.
  • 작업 내용에 대한 테스트 결과 스크린샷이 첨부되었습니다.
  • 코드 변경에 대한 테스트 작성 및 실행, 문서 작성/수정, 코드 컨벤션 준수, 의존성 문제 해결 체크리스트가 모두 완료되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@seoahS01 seoahS01 merged commit 4966f37 into main Feb 12, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly updates the Google login callback logic to use the state parameter instead of redirectUrl, which is a more secure and standard OAuth2 approach. However, this implementation introduces two security vulnerabilities: a high-severity OAuth CSRF vulnerability due to the lack of state nonce verification, and a medium-severity Open Redirect vulnerability due to weak validation of the redirect URL. Additionally, this change has broken existing test code, which needs to be updated to ensure the stability and correctness of the new implementation. Both the security vulnerabilities and the test failures must be addressed.

}

public GoogleCallbackDto loginWithGoogle(String code, String redirectUrl) {
public GoogleCallbackDto loginWithGoogle(String code, String state) {
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.

security-high high

The loginWithGoogle method's change to use the state parameter introduces a high-severity OAuth CSRF vulnerability. The state parameter should contain a cryptographically secure random nonce that is verified upon callback to prevent CSRF attacks. Without this, an attacker can link a victim's session to an attacker-controlled account. Additionally, this signature change will break existing tests in OauthServiceTest, which need to be updated to properly handle the state parameter.


String decodedRedirectUrl = UriUtils.decode(state, StandardCharsets.UTF_8);

validateRedirectUrl(decodedRedirectUrl);
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.

security-medium medium

The validateRedirectUrl method (called here) uses a weak prefix check (startsWith) to validate the redirect URL. This can be bypassed by an attacker using a domain that starts with a whitelisted entry (e.g., https://whitelisted.com.attacker.com). This allows for Open Redirect attacks, which can be used in phishing campaigns to redirect users to malicious sites after successful authentication. It is recommended to use a more robust validation that ensures the URL matches the whitelisted domain exactly or is a proper sub-path (e.g., by checking for a trailing slash).

@seoahS01 seoahS01 deleted the hotfix/48-googlelogin branch February 12, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞BugFix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant