<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>Cpe:2.3:a:oauth2_proxy_project:oauth2_proxy:*:*:*:*:*:*:*:* - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/cpes/cpe2.3aoauth2_proxy_projectoauth2_proxy/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Mon, 29 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/cpes/cpe2.3aoauth2_proxy_projectoauth2_proxy/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>OAuth2 Proxy Authentication Bypass via X-Forwarded-Uri Header Spoofing</title><link>https://feed.craftedsignal.io/briefs/2024-01-29-oauth2-proxy-auth-bypass/</link><pubDate>Mon, 29 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-29-oauth2-proxy-auth-bypass/</guid><description>OAuth2 Proxy is vulnerable to an authentication bypass when configured with `--reverse-proxy` and `--skip_auth_routes` or `--skip_auth_regex`; by spoofing the `X-Forwarded-Uri` header, an attacker can bypass authentication and access protected routes without a valid session.</description><content:encoded><![CDATA[<p>OAuth2 Proxy versions before 7.15.2 are susceptible to an authentication bypass vulnerability (CVE-2026-40575) when configured with both the <code>--reverse-proxy</code> flag and either <code>--skip_auth_routes</code> or <code>--skip_auth_regex</code>. This configuration flaw allows an attacker to spoof the <code>X-Forwarded-Uri</code> header, tricking OAuth2 Proxy into evaluating authentication and skip-auth rules against an attacker-controlled path rather than the actual request URI. The vulnerability exists because OAuth2 Proxy trusts client-supplied <code>X-Forwarded-Uri</code> headers. Version 7.15.2 introduces the <code>--trusted-proxy-ip</code> flag to mitigate this issue by allowing administrators to specify trusted reverse proxy IPs. However, upgrading alone is insufficient; the <code>--trusted-proxy-ip</code> flag must be configured, and additional mitigation steps are recommended to properly secure deployments.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker identifies an OAuth2 Proxy instance configured with <code>--reverse-proxy</code> and <code>--skip_auth_routes</code> (or <code>--skip_auth_regex</code>).</li>
<li>The attacker crafts a malicious HTTP request targeting a protected route.</li>
<li>The attacker adds an <code>X-Forwarded-Uri</code> header to the request, setting its value to a path configured in <code>--skip_auth_routes</code>.</li>
<li>The reverse proxy forwards the request, including the attacker-controlled <code>X-Forwarded-Uri</code> header, to the OAuth2 Proxy instance.</li>
<li>OAuth2 Proxy evaluates the <code>X-Forwarded-Uri</code> header against the <code>--skip_auth_routes</code> rules and incorrectly determines that authentication is not required.</li>
<li>OAuth2 Proxy forwards the request, now bypassing authentication, to the upstream application.</li>
<li>The upstream application processes the request, granting the attacker unauthorized access to the protected resource.</li>
<li>The attacker successfully accesses the protected route and performs unauthorized actions.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability (CVE-2026-40575) allows unauthenticated remote attackers to bypass authentication and access protected routes without valid credentials. This could lead to complete compromise of the application behind the OAuth2 Proxy instance, including data theft, modification, or service disruption. The severity is critical as it directly undermines the authentication mechanism, potentially affecting any organization using OAuth2 Proxy with the vulnerable configuration. The number of affected organizations is currently unknown, but any deployment meeting the criteria is vulnerable.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade OAuth2 Proxy to version 7.15.2 or later and configure the <code>--trusted-proxy-ip</code> flag to explicitly define trusted reverse proxy IPs to mitigate CVE-2026-40575.</li>
<li>Implement reverse proxy or load balancer rules to strip or overwrite the <code>X-Forwarded-Uri</code> header from client requests, ensuring OAuth2 Proxy receives the correct request URI, as shown in the nginx example.</li>
<li>Restrict direct client access to OAuth2 Proxy, ensuring it can only be reached through a trusted reverse proxy to prevent attackers from directly injecting malicious headers.</li>
<li>Review and narrow <code>--skip-auth-route</code> / <code>--skip-auth-regex</code> rules where possible to minimize the attack surface and reduce the potential for authentication bypass.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>oauth2-proxy</category><category>authentication-bypass</category><category>reverse-proxy</category><category>header-spoofing</category></item></channel></rss>