Miggo Logo

CVE-2025-54576: OAuth2-Proxy has authentication bypass in oauth2-proxy skip_auth_routes due to Query Parameter inclusion

9.1

CVSS Score
3.1

Basic Information

EPSS Score
-
Published
7/30/2025
Updated
7/30/2025
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/oauth2-proxy/oauth2-proxy/v7go<= 7.10.07.11.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability is an authentication bypass in the skip_auth_routes feature of oauth2-proxy. The root cause is that the regular expression matching for the skip routes was performed against the full request URI, including query parameters, instead of just the URL path. This flaw is located in the isAllowedPath function in oauthproxy.go, which used the requestutil.GetRequestURI function to get the string for matching. An attacker could exploit this by sending a request to a protected endpoint and adding a query string that matches a configured skip_auth_routes pattern. For instance, if ^/public/.* was configured as a skip route, a request to /protected_endpoint?param=/public/page would incorrectly match the rule and bypass authentication. The patch addresses this by introducing a new function, requestutil.GetRequestPath, which strips query parameters from the URI before the regex matching occurs in isAllowedPath. The analysis of the patch clearly points to isAllowedPath as the location of the flawed logic and util.GetRequestURI as the source of the unsanitized input that enables the bypass.

Vulnerable functions

isAllowedPath
oauthproxy.go
This function is responsible for checking if a request path is allowed to skip authentication based on the 'skip_auth_routes' configuration. The vulnerability lies in this function's use of `requestutil.GetRequestURI(req)`, which includes query parameters in the string being matched against the regex. This allowed an attacker to craft a URL with query parameters that would match a skip rule, thus bypassing authentication for a protected endpoint.
util.GetRequestURI
pkg/requests/util/util.go
This function retrieves the request URI. In the context of this vulnerability, it provides the unsanitized input (the full URI including query parameters) to the `isAllowedPath` function. An attacker's crafted URL, containing malicious query parameters, would be processed by this function, and its output would lead to the authentication bypass in `isAllowedPath`. Therefore, this function is a key part of the exploit chain.

WAF Protection Rules

WAF Rule

### Imp**t T*is vuln*r**ility *****ts o*ut**-proxy **ploym*nts usin* t** `skip_*ut*_rout*s` *on*i*ur*tion option wit* r***x p*tt*rns. T** vuln*r**ility *llows *tt**k*rs to *yp*ss *ut**nti**tion *y *r**tin* URLs wit* qu*ry p*r*m*t*rs t**t s*tis*y t**

Reasoning

T** vuln*r**ility is *n *ut**nti**tion *yp*ss in t** `skip_*ut*_rout*s` ***tur* o* `o*ut**-proxy`. T** root **us* is t**t t** r**ul*r *xpr*ssion m*t**in* *or t** skip rout*s w*s p*r*orm** ***inst t** *ull r*qu*st URI, in*lu*in* qu*ry p*r*m*t*rs, inst