Repository navigation
fix: 로그인 returnTo를 오리진 정확 일치로 검사 - #548
Conversation
접두 비교라 caquick.site.evil.com·caquick.site@evil.com 같은 주소가 통과해 로그인 뒤 외부로 보낼 수 있었다. URL로 파싱해 http(s)이고 오리진이 허용 목록과 같을 때만 그 주소를 쓴다. - return-to.helper.ts 추가, OidcLoginService.normalizeReturnTo가 사용 - 회귀 테스트 15건(it.each 표: 허용 3·거부 11·기본 주소 오리진 1)
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🧹 knip — dead-code 리포트전체 리포트
|
🩺 NestJS Doctor — 90/100 (Excellent)진단 493건 (error 13).
architecture / security 상위 항목
|
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success4333 tests passing in 389 suites. Report generated by 🧪jest coverage report action from e4d8994 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
개요
로그인 returnTo 검사가 접두 비교(
startsWith)라서 허용 도메인으로 시작하기만 하면 다른 호스트도 통과했습니다. 오리진이 정확히 같을 때만 허용하도록 바꿉니다.https://caquick.site.evil.com,https://caquick.site@evil.com,https://caquick.siteevil.com이 모두 허용됐습니다..com에도 생기므로 도메인 이전과 함께 막습니다.변경 사항
helpers/return-to.helper.ts: returnTo를 URL로 파싱해 http(s)이고 오리진이 허용 목록(기본 프론트 주소 포함)과 정확히 같을 때만 그 주소를, 아니면 기본 프론트 주소를 돌려줍니다.OidcLoginService.normalizeReturnTo가 이 헬퍼를 씁니다.테스트
return-to.helper.spec.ts(it.each표)//evil.com, 상대 경로,javascript:, 빈 값·공백·undefined플랜 대조
fix/oidc-return-to-origin-match불릿@우회 주소가 기본값으로 떨어지는지