{"id":"CVE-2026-40575","aliases":["CVE-2026-40575","GHSA-7x63-xv5r-3p2x","BIT-OAUTH2-PROXY-2026-40575","BIT-OAUTH2-PROXY-2026-76835","GO-2026-5236"],"related":["CVE-2026-76835"],"kind":"vulnerability","state":"published","title":"OAuth2 Proxy has an Authentication Bypass via X-Forwarded-Uri Header Spoofing","summary":"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.","summarySource":"cvelist","descriptions":[{"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.","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 es un proxy inverso que proporciona autenticación utilizando proveedores OAuth2. Las versiones 7.5.0 a 7.15.1 pueden confiar en un encabezado ’X-Forwarded-Uri’ proporcionado por el cliente cuando ’- -reverse-proxy’ está habilitado y ’- -skip-auth-regex’ o ’- -skip-auth-route’ está configurado. Un atacante puede falsificar este encabezado para que OAuth2 Proxy evalúe las reglas de autenticación y de omisión de autenticación contra una ruta diferente a la que realmente se envió a la aplicación ascendente. Esto puede resultar en que un atacante remoto no autenticado omita la autenticación y acceda a rutas protegidas sin una sesión válida. Los usuarios afectados son las implementaciones que ejecutan oauth2-proxy con ’- -reverse-proxy’ habilitado y configuran al menos una regla ’- -skip-auth-regex’ o ’- -skip-auth-route’. Este problema está parcheado en ’v7.15.2’. Algunas soluciones temporales están disponibles para aquellos que no pueden actualizar de inmediato. Elimine cualquier encabezado ’X-Forwarded-Uri’ proporcionado por el cliente a nivel del proxy inverso o balanceador de carga; sobrescriba explícitamente ’X-Forwarded-Uri’ con la URI de solicitud real antes de reenviar las solicitudes a OAuth2 Proxy; restrinja el acceso directo del cliente a OAuth2 Proxy para que solo se pueda acceder a él a través de un proxy inverso de confianza; y/o elimine o restrinja las reglas ’- -skip-auth-regex’ / ’- -skip-auth-route’ donde sea posible. Para implementaciones basadas en nginx, asegúrese de que ’X-Forwarded-Uri’ sea establecido por nginx y no se pase desde el cliente.","source":"nvd"},{"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.","format":"markdown","source":"bitnami"}],"published":"2026-04-15T19:21:06.000Z","modified":"2026-11-11T23:10:00.263Z","severity":{"scorer":"GitHub_M","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"},"severities":[{"scorer":"GitHub_M","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":"redhat-SADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N","score":8.7,"rating":"HIGH"},{"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":[{"version":">= 7.5.0, < 7.15.2","status":"affected"}],"vendor":"oauth2-proxy","product":"oauth2-proxy","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Ceph Storage 9","package":"rhceph/oauth2-proxy-rhel9","cpe":"cpe:/a:redhat:ceph_storage:9","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":[{"status":"affected","introduced":"7.5.0","fixed":"7.15.2"}],"vendor":"oauth2_proxy_project","product":"oauth2_proxy","cpe":"cpe:2.3:a:oauth2_proxy_project:oauth2_proxy:*:*:*:*:*:*:*:*","source":"nvd"},{"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/security/advisories/GHSA-7x63-xv5r-3p2x","tags":["advisory","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-40575","tags":["vdb-entry","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2460449","tags":["issue-tracking","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40575.json","tags":["web","x-sadp-csaf-vex"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40575","tags":["advisory","web"],"sources":["ghsa","go","bitnami"]},{"url":"https://github.com/oauth2-proxy/oauth2-proxy","tags":["package","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/oauth2-proxy/oauth2-proxy/blob/v7.15.4/pkg/apis/middleware/scope.go","tags":["web"],"sources":["bitnami"]},{"url":"https://github.com/oauth2-proxy/oauth2-proxy/issues/3506","tags":["web"],"sources":["bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-76835","tags":["web"],"sources":["bitnami"]},{"url":"https://www.vulncheck.com/advisories/oauth2-proxy-through-authentication-bypass-via-x-forwarded-uri-under-the-default-trusted-proxy-set","tags":["web"],"sources":["bitnami"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-04-22T14:15:18.160Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40575","url":"https://www.cve.org/CVERecord?id=CVE-2026-40575","licence":"CVE Terms of Use","modified":"2026-07-15T01:00:45.240Z"},{"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-40575","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40575","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"},{"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:19.213Z","epss":{"score":0.00486,"percentile":0.43472,"date":"2026-12-01T12:00:22.000Z"}}