CVE-2020-4037: Open Redirect in OAuth2 Proxy

Summary

20/12/2021
Yes i
Moderate
4.3

CVE-2020-4037: Open Redirect in OAuth2 Proxy. Affects github.com/oauth2-proxy/oauth2-proxy versions >= 5.1.1, < 6.0.0. Fixed in 6.0.0. How to fix ↓

Also tracked for

The same CVE-2020-4037 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The OAuth2 Proxy package is a Go-based tool that provides authentication and authorization for web applications using OAuth2 providers. It acts as a reverse proxy, handling the authentication flow and forwarding requests to the appropriate backend server. The package is widely used for securing web applications and APIs.

Vulnerability Detail

The vulnerability identified as CVE-2020-4037 is an open redirect issue in OAuth2 Proxy. When users authenticate through the proxy, they can provide a redirect address for the proxy to send them to after the authentication flow. This redirect URL is expected to be the original URL that the user was trying to access. However, the proxy fails to properly validate and sanitize this redirect URL, allowing malicious actors to provide redirects to potentially harmful sites. This can lead to various attacks, such as phishing or redirecting users to malicious websites.

How To Fix

Latest published version: v3.2.0+incompatible as of 22 Oct 2026

go get github.com/oauth2-proxy/oauth2-proxy@v3.2.0+incompatible

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

6.0.0

This is the first release that contains the fix.

go get github.com/oauth2-proxy/oauth2-proxy@v6.0.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating to the latest version is not immediately feasible, a temporary workaround is to manually validate and sanitize the redirect URL within the application code before passing it to the OAuth2 Proxy. This can be done by checking the URL against a whitelist of allowed domains or using a regular expression to ensure it matches the expected format. However, this workaround is not recommended as it relies on custom code and may introduce additional complexity and potential vulnerabilities.

Conclusion

The open redirect vulnerability in OAuth2 Proxy (CVE-2020-4037) can be mitigated by updating to version 6.0.0 or later of the package. It is crucial to ensure that the OAuth2 Proxy configuration is properly set up to handle redirects securely. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for github.com/oauth2-proxy/oauth2-proxy →

Share this vulnerability

FAQ

OAuth2 Proxy is a Go-based tool that provides authentication and authorization for web applications using OAuth2 providers. It acts as a reverse proxy, handling the authentication flow and forwarding requests to the appropriate backend server.

An open redirect vulnerability occurs when a web application or service allows users to specify a redirect URL after a certain action, but fails to properly validate and sanitize the provided URL. This can be exploited by attackers to redirect users to malicious websites or phishing pages.

The open redirect vulnerability in OAuth2 Proxy can be exploited by attackers to redirect users to malicious websites, phishing pages, or other harmful destinations. This can lead to various attacks, such as stealing user credentials, spreading malware, or tricking users into performing unintended actions.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities, using Gopkg.lock to analyze the software without requiring access to the code or installation.

There are no known public exploits for this vulnerability at the time of this report. However, it is important to promptly update to the latest version of OAuth2 Proxy to mitigate the risk of potential attacks.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/oauth2-proxy/oauth2-proxy.

How To Fix

Latest published version: v3.2.0+incompatible as of 22 Oct 2026

go get github.com/oauth2-proxy/oauth2-proxy@v3.2.0+incompatible

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

6.0.0

This is the first release that contains the fix.

go get github.com/oauth2-proxy/oauth2-proxy@v6.0.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback