🇰🇷 한글 설명
OAuth2 Proxy가 인증을 건너뛸 경로를 결정할 때 클라이언트가 제공한 X-Forwarded-Uri 헤더를 신뢰하여 발생하는 취약점입니다. 기본 설정에서 모든 클라이언트가 신뢰할 수 있는 프록시로 간주되므로, 공격자가 헤더를 조작하여 인증 없이 보호된 경로에 접근할 수 있습니다.
💡 쉬운 설명
공격자가 가짜 정보를 담은 특수 헤더를 보내면, 보안 시스템이 이를 정상적인 요청으로 착각하여 로그인 없이 내부 서비스에 접속하게 됩니다. 이는 마치 출입증 없이 가짜 신분증을 보여주었을 때 경비원이 통과시켜 주는 것과 같습니다.
🇺🇸 원문 (English)
OAuth2 Proxy honours a client-supplied X-Forwarded-Uri header when deciding whether a request may skip authentication, because the guard added for CVE-2026-40575 is inert in the default reverse-proxy configuration. GetRequestURI in pkg/requests/util/util.go prefers that header over the real request URI whenever CanTrustForwardedHeaders returns true, and isAllowedPath in oauthproxy.go matches the skip_auth_routes and skip_auth_regex allow list against the resulting path. CanTrustForwardedHeaders in pkg/apis/middleware/scope.go grants that trust when the caller's address is in the trusted proxy set, and buildTrustedProxyNetSet falls back to defaultTrustedProxyIPs, which is 0.0.0.0/0 and ::/0, whenever reverse proxy mode is enabled without trusted_proxy_ip configured. Every client is therefore treated as a trusted proxy. An unauthenticated attacker can request a protected upstream path while setting X-Forwarded-Uri to a value matching an allow-listed route, so the skip-auth decision is made against the spoofed value while the upstream receives the protected path unchanged.
📍 영향받는 시스템
OAuth2 Proxy (reverse proxy mode가 활성화되어 있고 trusted_proxy_ip가 설정되지 않은 모든 버전)
⚔️ 공격 벡터
X-Forwarded-Uri 헤더에 허용된 경로(skip_auth_routes)를 삽입하여 인증 과정을 우회하는 HTTP 요청 전송
🛡️ 대응 방법
trusted_proxy_ip 설정을 통해 신뢰할 수 있는 프록시 IP를 명시적으로 지정하거나 최신 보안 패치를 적용하십시오.
🔧 검증 코드
응답 코드가 200 OK라면 인증 우회에 성공한 것이며, 401 Unauthorized 또는 403 Forbidden이면 안전한 상태입니다.
curl -I -H 'X-Forwarded-Uri: /allowed-path' http://<target-oauth2-proxy>/protected-path