User Impersonation Affecting github.com/oauth2-proxy/oauth2-proxy/pkg/validation package, versions <7.15.2


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.48% (38th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GITHUBCOMOAUTH2PROXYOAUTH2PROXYPKGVALIDATION-16121349
  • published22 Apr 2026
  • disclosed22 Apr 2026
  • creditRahul Maini

Introduced: 22 Apr 2026

CVE-2026-40575  (opens in a new tab)
CWE-290  (opens in a new tab)

How to fix?

Upgrade github.com/oauth2-proxy/oauth2-proxy/pkg/validation to version 7.15.2 or higher.

Overview

Affected versions of this package are vulnerable to User Impersonation via the X-Forwarded-Uri header when the --reverse-proxy setting is enabled and either --skip-auth-regex or --skip-auth-route is configured. An attacker can gain unauthorized access to protected routes by spoofing the X-Forwarded-Uri header, causing authentication and skip-auth rules to be evaluated against a different path than the one actually requested.

Workaround

This vulnerability can be mitigated by stripping any client-provided X-Forwarded-Uri header at the reverse proxy or load balancer level, explicitly overwriting X-Forwarded-Uri with the actual request URI before forwarding requests, restricting direct client access so only a trusted reverse proxy can reach the service, and/or removing or narrowing --skip-auth-regex / --skip-auth-route rules. For nginx-based deployments, ensure X-Forwarded-Uri is set by nginx and not passed through from the client.

CVSS Base Scores

version 4.0
version 3.1