{"id":"CVE-2026-76835","aliases":["CVE-2026-76835","GHSA-7x63-xv5r-3p2x","BIT-OAUTH2-PROXY-2026-40575","BIT-OAUTH2-PROXY-2026-76835","GO-2026-5236"],"related":["CVE-2026-40575"],"kind":"vulnerability","state":"published","title":"OAuth2 Proxy 7.15.2 through 7.15.4 Authentication Bypass via X-Forwarded-Uri Under the Default Trusted Proxy Set","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nA configuration-dependent authentication bypass exists in OAuth2 Proxy.\n\nDeployments are affected when all of the following are true:\n\n* OAuth2 Proxy is configured with `--reverse-proxy`\n* and at least one rule is defined with `--skip_auth_routes` or the legacy `--skip-auth-regex`\n\nOAuth2 Proxy may trust a client-supplied `X-Forwarded-Uri` header when `--reverse-proxy` is enabled and `--skip-auth-route` or `--skip-auth-regex` 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.\n\nThis can result in an unauthenticated remote attacker bypassing authentication and accessing protected routes without a valid session.\n\n\n### Patches\nThis issue is addressed as part of the newly introduced `--trusted-proxy-ip` flag in `v7.15.2`. If you leave it unset, OAuth2 Proxy will **continue to trust ALL** source IPs (0.0.0.0/0) for backwards compatibility, which means a client may still be able to spoof forwarded headers. Therefore after upgrading we urge you to use the new `--trusted-proxy-ip` flag to set the IPs or CIDR ranges of the reverse proxies that are allowed to send `X-Forwarded-*` headers and furthermore implement the mitigation steps outlined below to properly configure your load balancer infrastructure.\n\n### Mitigation\n\n- Strip any client-provided `X-Forwarded-Uri` header at the reverse proxy or load balancer level\n- Explicitly overwrite `X-Forwarded-Uri` with the actual request URI before forwarding requests to OAuth2 Proxy\n\n  Example nginx mitigation for the auth subrequest:\n  ```\n    location /internal-auth/ {\n      internal; # Ensure external users can't access this path\n  \n      # Make sure the OAuth2 Proxy knows where the original request came from.\n      proxy_set_header Host       $host;\n      proxy_set_header X-Real-IP  $remote_addr;\n      # set the value to the actual $request_uri and therefore strip any user provided X-Forwarded-Uri\n      proxy_set_header X-Forwarded-Uri $request_uri;\n  \n      proxy_pass http://oauth2-proxy:4180/;\n    }\n  ```\n- Restrict direct client access to OAuth2 Proxy so it can only be reached through a trusted reverse proxy\n- Remove or narrow `--skip-auth-route` / `--skip-auth-regex` rules where possible","format":"markdown","source":"ghsa"},{"lang":"en","text":"OAuth2 Proxy has an Authentication Bypass via X-Forwarded-Uri Header Spoofing in github.com/oauth2-proxy/oauth2-proxy","format":"markdown","source":"go"},{"lang":"es","text":"OAuth2 Proxy respeta un encabezado X-Forwarded-Uri proporcionado por el cliente al decidir si una solicitud puede omitir la autenticación, porque la protección añadida para CVE-2026-40575 es inerte en la configuración predeterminada de proxy inverso. GetRequestURI en pkg/requests/util/util.go prefiere ese encabezado sobre la URI de solicitud real siempre que CanTrustForwardedHeaders devuelva verdadero, e isAllowedPath en oauthproxy.go compara la lista de permitidos skip_auth_routes y skip_auth_regex con la ruta resultante. CanTrustForwardedHeaders en pkg/apis/middleware/scope.go otorga esa confianza cuando la dirección del llamante está en el conjunto de proxies de confianza, y buildTrustedProxyNetSet recurre a defaultTrustedProxyIPs, que es 0.0.0.0/0 y ::/0, siempre que el modo de proxy inverso esté habilitado sin trusted_proxy_ip configurado. Cada cliente es, por lo tanto, tratado como un proxy de confianza. Un atacante no autenticado puede solicitar una ruta ascendente protegida mientras establece X-Forwarded-Uri a un valor que coincide con una ruta permitida, por lo que la decisión de omitir la autenticación se toma contra el valor falsificado mientras que el sistema ascendente recibe la ruta protegida sin cambios.","source":"nvd"},{"lang":"en","text":"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.","format":"markdown","source":"bitnami"}],"published":"2026-04-15T19:21:06.000Z","modified":"2026-10-13T09:10:00.323Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N","score":9.3,"rating":"CRITICAL"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N","score":9.3,"rating":"CRITICAL"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"CRITICAL"}],"cwes":["CWE-290"],"affected":[{"ranges":[{"type":"semver","introduced":"7.15.2","lastAffected":"7.15.4","status":"affected"}],"vendor":"oauth2-proxy","product":"oauth2-proxy","repo":"https://github.com/oauth2-proxy/oauth2-proxy","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"7.5.0","status":"affected","fixed":"7.15.2"}],"ecosystem":"Go","package":"github.com/oauth2-proxy/oauth2-proxy/v7","purl":"pkg:golang/github.com/oauth2-proxy/oauth2-proxy/v7","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/oauth2-proxy/oauth2-proxy","purl":"pkg:golang/github.com/oauth2-proxy/oauth2-proxy","source":"go"},{"ranges":[{"type":"semver","introduced":"7.5.0","status":"affected","fixed":"7.15.2"}],"ecosystem":"Go","package":"github.com/oauth2-proxy/oauth2-proxy/v7","purl":"pkg:golang/github.com/oauth2-proxy/oauth2-proxy/v7","source":"go"},{"ranges":[{"type":"semver","introduced":"7.5.0","status":"affected","fixed":"7.15.2"}],"ecosystem":"Bitnami","package":"oauth2-proxy","purl":"pkg:bitnami/oauth2-proxy","source":"bitnami"},{"ranges":[{"type":"semver","introduced":"7.15.2","status":"affected","fixed":"7.15.5"}],"ecosystem":"Bitnami","package":"oauth2-proxy","purl":"pkg:bitnami/oauth2-proxy","source":"bitnami"}],"references":[{"url":"https://github.com/oauth2-proxy/oauth2-proxy","tags":["package","product","web"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/oauth2-proxy/oauth2-proxy/issues/3506","tags":["exploit","issue-tracking","web"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://github.com/oauth2-proxy/oauth2-proxy/blob/v7.15.4/pkg/apis/middleware/scope.go","tags":["technical-description","web"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://github.com/oauth2-proxy/oauth2-proxy/security/advisories/GHSA-7x63-xv5r-3p2x","tags":["advisory","vendor-advisory","web"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://www.vulncheck.com/advisories/oauth2-proxy-through-authentication-bypass-via-x-forwarded-uri-under-the-default-trusted-proxy-set","tags":["third-party-advisory","web"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40575","tags":["advisory","web"],"sources":["ghsa","go","bitnami"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-40575","tags":["web"],"sources":["ghsa","bitnami"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2460449","tags":["web"],"sources":["ghsa","bitnami"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40575.json","tags":["web"],"sources":["ghsa","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-76835","tags":["web"],"sources":["bitnami"]}],"credits":["George Chen"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-08-24T20:00:05.680Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-76835","url":"https://www.cve.org/CVERecord?id=CVE-2026-76835","licence":"CVE Terms of Use","modified":"2026-10-08T15:25:05.218Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-7x63-xv5r-3p2x","url":"https://github.com/advisories/GHSA-7x63-xv5r-3p2x","licence":"CC-BY-4.0","modified":"2026-09-25T14:25:56.584Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5236","url":"https://pkg.go.dev/vuln/GO-2026-5236","licence":"CC-BY-4.0","modified":"2026-09-25T14:25:56.584Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-76835","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-76835","licence":"Public domain","modified":"2026-10-13T09:10:00.323Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-OAUTH2-PROXY-2026-40575","url":"https://osv.dev/vulnerability/BIT-OAUTH2-PROXY-2026-40575","licence":"Apache-2.0","modified":"2026-09-25T14:25:56.584Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-OAUTH2-PROXY-2026-76835","url":"https://osv.dev/vulnerability/BIT-OAUTH2-PROXY-2026-76835","licence":"Apache-2.0","modified":"2026-10-01T12:15:02.476Z"}],"updatedAt":"2026-11-25T22:59:35.054Z","epss":{"score":0.00453,"percentile":0.41044,"date":"2026-12-01T12:00:22.000Z"}}