REDHAT-BUG-2522418: High severity OAuth2 Proxy OAuth2 Proxy vulnerability
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 skipauthroutes and skipauthregex 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 trustedproxyip 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Configure trusted_proxy_ip with the actual trusted proxy addresses instead of relying on the default 0.0.0.0/0 and ::/0 ranges.
OAuth2 Proxy trusted_proxy_ip = Explicit trusted proxy IPs/CIDRs
Event History
Frequently Asked Questions
Which deployments are exposed?
Deployments with reverse-proxy mode enabled, no trusted_proxy_ip configured, and skip_auth_routes or skip_auth_regex entries are exposed. In that configuration, the trusted-proxy fallback includes all IPv4 and IPv6 addresses, so any client is treated as a trusted proxy.
What does an attacker need to exploit this?
An unauthenticated attacker needs network access to the OAuth2 Proxy endpoint and knowledge of a path that matches a configured skip-auth allow-list entry. They can request a protected upstream path while supplying X-Forwarded-Uri with the allow-listed path.
What can be done if patching is not immediately possible?
Configure trusted_proxy_ip with only the addresses or networks of the actual reverse proxies. This prevents the default 0.0.0.0/0 and ::/0 trusted-proxy fallback from treating every client as trusted.