cve.bz

CVE-2026-40575 oauth2 proxy project oauth2 proxy: Authentication Bypass by Spoofing

9.1 criticalEPSS 0.5%Fix available

Critical (9.1) in oauth2 proxy project oauth2 proxy. EPSS 0.5% estimated probability of exploitation activity in the next 30 days. Fixed in github.com/oauth2-proxy/oauth2-proxy/v7 7.15.2.

On this page
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.

Severity

CVSS 3.1

9.1 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
EPSS
0.5% (unchanged from 0.5% a week ago; 0.7% 30 days ago) estimated probability of exploitation activity in the next 30 days; 43rd percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: total, assessed 2026-04-22. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-290 Authentication Bypass by Spoofing
OWASP Top 10
A07:2025 Authentication Failures
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-40575 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-40575?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-40575?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-40575 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
oauth2_proxy_project:oauth2_proxyfrom 7.5.0 before 7.15.2

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-7x63-xv5r-3p2xGogithub.com/oauth2-proxy/oauth2-proxy/v7>=7.5.0 <7.15.27.15.2
GO-2026-5236Gogithub.com/oauth2-proxy/oauth2-proxyall versionsno fix published
GO-2026-5236Gogithub.com/oauth2-proxy/oauth2-proxy/v7>=7.5.0 <7.15.27.15.2

Linux distributions

DistributionReleasePackageFixed inAdvisory
Red Hathummingbird:1oauth2-proxy0:7.15.4-0.1.hum1RHSA-2026:58471
openSUSELeap 16.0govulncheck-vulndb0.0.20260723T184607-160000.1.1openSUSE-SU-2026:21483-1

From the distributions' data via OSV.dev: Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Red Hat · openSUSE.

Red Hat

Red Hat rates this Important.

Red Hat's statement

There's an Important flaw in `oauth2-proxy` software where it trusts a client supplied `X-Forwarded-Uri` request header. This header is used by `oauth2-proxy` to identify the original URI from the incoming request it's currently handling. An attacker which manages to spoof the requests sent to it when it's running behind a reverse-proxy may change this header field to match the routes or the regular expressions configured to have authentication skipped, as a consequence the attacker may manage to have access to protected resources or internal routes without any kind of authentication being required resulting in a high impact for data confidentiality and integrity for the services positioned behind the reverse proxy.

Red Hat Product Security team has rated this vulnerability as having a impact of Important as for a `oauth2-proxy` being considered vulnerable it should be being executed with the following specific configuration options enabled:

1) `--reverse-proxy`

2) `--skip-auth-regex` or `--skip-auth-route`

Additionally to exploit this vulnerability the attacker should be able to change the headers in the request being sent (either via a local proxy or by performing a Man-In-The-Middle attack before) and should have previous knowledge about the routes or patterns of URI which the authentication are being skipped by the `oauth2-proxy` deployment.

Red Hat's mitigation

This issue can be mitigated by one of the options bellow:

1) Strip any client-provided `X-Forwarded-Uri` header at any layer before it reaches `oauth2-proxy`;

2) Overwrite the `X-Forwarded-Uri` header with the actual request URI before the request reaches `oauth2-proxy`. If you are using NGINX you can use the following example to create your tailored mitigation:

~~~

location /internal-auth/ {

internal; # Ensure external users can't access this path

# Make sure the OAuth2 Proxy knows where the original request came from.

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

# set the value to the actual $request_uri and therefore strip any user provided X-Forwarded-Uri

proxy_set_header X-Forwarded-Uri $request_uri;

proxy_pass http://oauth2-proxy:4180/;

}

~~~

3) Restrict direct client access to OAuth2 Proxy so it can only be reached through a trusted reverse proxy;

4) Remove or narrow --skip-auth-route / --skip-auth-regex rules where possible;

ProductPackageStateAdvisory
Red Hat Hardened Imagesoauth2-proxy-main-7.15.4-0.1.hum1Fixed 2026-08-22RHSA-2026:58471
Red Hat Ceph Storage 9rhceph/oauth2-proxy-rhel9Affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-40575.

Attack patterns (CAPEC)

  • CAPEC-21 Exploitation of Trusted Identifiers Likelihood: High · Severity: High
  • CAPEC-22 Exploiting Trust in Client Likelihood: High · Severity: High
  • CAPEC-59 Session Credential Falsification through Prediction Likelihood: High · Severity: High
  • CAPEC-60 Reusing Session IDs (aka Session Replay) Likelihood: High · Severity: High
  • CAPEC-94 Adversary in the Middle (AiTM) Likelihood: High · Severity: Very High
  • CAPEC-459 Creating a Rogue Certification Authority Certificate Likelihood: Medium · Severity: Very High
  • CAPEC-461 Web Services API Signature Forgery Leveraging Hash Function Extension Weakness Severity: High
  • CAPEC-473 Signature Spoof
  • CAPEC-476 Signature Spoofing by Misrepresentation Likelihood: Low · Severity: High
  • CAPEC-667 Bluetooth Impersonation AttackS (BIAS) Likelihood: Medium · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON