🇰🇷 한글 설명
OAuth2 Proxy 7.5.0~7.15.1에서 --reverse-proxy와 --skip-auth-regex/--skip-auth-route 설정 시, 클라이언트 제공 X-Forwarded-Uri 헤더를 신뢰하여 인증 규칙 우회가 가능합니다. 공격자가 헤더를 조작하면 실제 요청과 다른 경로에 대해 인증을 평가하도록 속일 수 있으며, 인증 없이 보호된 경로에 접근할 수 있습니다.
💡 쉬운 설명
OAuth2 Proxy가 클라이언트가 보낸 가짜 경로 정보를 믿고 인증 규칙을 적용합니다. 공격자가 이를 조작하면 로그인 없이 보호된 사이트에 접근할 수 있습니다.
🇺🇸 원문 (English)
OAuth2 Proxy is a reverse proxy that provides authentication using OAuth2 providers. Versions 7.5.0 through 7.15.1 may trust a client-supplied `X-Forwarded-Uri` header when `--reverse-proxy` is enabled and `--skip-auth-regex` or `--skip-auth-route` is configured. An attacker can spoof this header so OAuth2 Proxy evaluates authentication and skip-auth rules against a different path than the one actually sent to the upstream application. This can result in an unauthenticated remote attacker bypassing authentication and accessing protected routes without a valid session. Impacted users are deployments that run oauth2-proxy with `--reverse-proxy` enabled and configure at least one `--skip-auth-regex` or `--skip-auth-route` rule. This issue is patched in `v7.15.2`. Some workarounds are available for those who cannot upgrade immediately. Strip any client-provided `X-Forwarded-Uri` header at the reverse proxy or load balancer level; explicitly overwrite `X-Forwarded-Uri` with the actual request URI before forwarding requests to OAuth2 Proxy; restrict direct client access to OAuth2 Proxy so it can only be reached through a trusted reverse proxy; and/or remove or narrow `--skip-auth-regex` / `--skip-auth-route` rules where possible. For nginx-based deployments, ensure `X-Forwarded-Uri` is set by nginx and not passed through from the client.
📍 영향받는 시스템
OAuth2 Proxy 7.5.0~7.15.1 (--reverse-proxy 활성화 및 --skip-auth-regex 또는 --skip-auth-route 설정된 배포)
⚔️ 공격 벡터
X-Forwarded-Uri 헤더 조작으로 인증 스킵 규칙이 적용되도록 위장하여 인증 우회
🛡️ 대응 방법
v7.15.2로 업그레이드 또는 역프록시/로드밸런서에서 X-Forwarded-Uri 헤더 제거/덮어쓰기
🔧 검증 코드
7.15.2 이상: 안전함 / 7.15.1 이하: 취약함 (즉시 업그레이드 필요)
oauth2-proxy --version 2>/dev/null || docker inspect $(docker ps -q -f ancestor=oauth2-proxy) 2>/dev/null | grep -i version