User Impersonation Affecting github.com/oauth2-proxy/oauth2-proxy/v7/pkg/middleware 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-GITHUBCOMOAUTH2PROXYOAUTH2PROXYV7PKGMIDDLEWARE-16083670
  • published16 Apr 2026
  • disclosed14 Apr 2026
  • creditiamnoooob

Introduced: 14 Apr 2026

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

How to fix?

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

Overview

Affected versions of this package are vulnerable to User Impersonation via the isHealthCheckRequest function in pkg/middleware/healthcheck.go. An attacker can reach protected endpoints by sending a request with a configured health-check User-Agent, causing the middleware to treat the request as a health check and skip normal authentication. This allows unauthenticated access to routes, such as the auth request endpoint, when a matching health-check user agent is accepted.

Notes

  • The bypass is configuration-gated: it's only applicable in auth_request-style deployments that also enable --ping-user-agent or --gcp-healthchecks; setups that rely on other request flows or leave those health-check options unset are not in scope.

Workarounds

  • Disable --gcp-healthchecks if you do not need Google Cloud health checks; this prevents requests with the GoogleHC/1.0 user agent from being treated as health checks.
  • Remove any configured --ping-user-agent; this prevents client requests that match that user agent from bypassing normal authentication handling.
  • Configure your reverse proxy so it does not forward client-controlled User-Agent headers to the OAuth2 Proxy auth subrequest; this prevents an attacker from supplying a matching health-check user agent to the protected auth endpoint.

CVSS Base Scores

version 4.0
version 3.1