fix(security): SSO 데드쿠키 제거 + open redirect 방어 + system2 수정

- SSO auth: 서버측 httpOnly 쿠키 제거 (클라이언트 domain cookie로 대체)
- SSO auth: extractToken()에서 미작동 req.cookies 코드 제거
- Gateway login.html: redirect 파라미터 open redirect 취약점 방어
- System 2: 인라인 requireAuth → middlewares/auth.js 사용
- System 2: 404/에러 핸들러 등록 순서 수정 (Express 모범사례)
- .gitignore: *.bak* 패턴 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-02-25 08:22:53 +09:00
parent 93edf9529a
commit faf365e0c6
4 changed files with 17 additions and 52 deletions

View File

@@ -161,7 +161,12 @@
// redirect 파라미터가 있으면 해당 URL로, 없으면 포털로
var redirect = new URLSearchParams(location.search).get('redirect');
window.location.href = redirect || '/';
// Open redirect 방지: 상대 경로 또는 같은 도메인만 허용
if (redirect && (redirect.startsWith('/') && !redirect.startsWith('//')) && !redirect.includes('://')) {
window.location.href = redirect;
} else {
window.location.href = '/';
}
} catch (err) {
errEl.textContent = err.message;
errEl.style.display = '';