CVE-2020-11053: Github.com/oauth2 proxy/oauth2 proxy Open Redirect Vulnerability
HIGHCVE-2020-11053 is a HIGH (CVSS 7.1) open redirect vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Github.com/oauth2 proxy/oauth2 proxy libraries in the Go ecosystem. The issue involves open redirect in oauth2 proxy. Remediation is available by upgrading affected packages to version 5.1.1.
CVE-2020-11053 at a Glance
Security Impact
CVSS: 7.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L).
How to Fix CVE-2020-11053
To remediate this vulnerability, upgrade all affected Github.com/oauth2 proxy/oauth2 proxy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/oauth2-proxy/oauth2-proxy to 5.1.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/oauth2-proxy/oauth2-proxy
How to Check if You Are Affected
To determine whether your application is affected by CVE-2020-11053, inspect your project dependencies for Github.com/oauth2 proxy/oauth2 proxy:
inspect dependencies for github.com/oauth2-proxy/oauth2-proxy
Analyze the terminal output to locate any version of Github.com/oauth2 proxy/oauth2 proxy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.1.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Github.com/oauth2 proxy/oauth2 proxy, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-11053 Affected Github.com/oauth2 proxy/oauth2 proxy Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/oauth2-proxy/oauth2-proxy
|
Go |
< 5.1.1
|
5.1.1
|
References
Frequently Asked Questions
What is CVE-2020-11053?
Which Github.com/oauth2 proxy/oauth2 proxy versions are affected?
What version fixes CVE-2020-11053?
Is github.com/oauth2-proxy/oauth2-proxy affected?
What is the CVSS score of CVE-2020-11053?
What CWE is associated with CVE-2020-11053?
How can I check Go dependencies for CVE-2020-11053?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-j7px-6hwj-hpjg",
"modified" : "2024-02-15T06:33:23Z",
"published" : "2021-12-20T17:59:10Z",
"aliases" : [ "CVE-2020-11053" ],
"summary" : "Open Redirect in OAuth2 Proxy",
"details" : "### Impact\nAs users can provide a redirect address for the proxy to send the authenticated user to at the end of the authentication flow. This is expected to be the original URL that the user was trying to access.\nThis redirect URL is checked within the proxy and validated before redirecting the user to prevent malicious actors providing redirects to potentially harmful sites.\n\nHowever, by crafting a redirect URL with HTML encoded whitespace characters (eg. `%0a`, `%0b`,`%09`,`%0d`) the validation could be bypassed and allow a redirect to any URL provided.\n\n### Patches\n@rootxharsh and @iamnoooob provided this patch as potential solution:\n```\nFrom 4b941f56eda310b5c4dc8080b7635a6bfabccad4 Mon Sep 17 00:00:00 2001\nFrom: Harsh Jaiswal <harsh@pop-os.localdomain>\nDate: Fri, 1 May 2020 20:38:31 +0530\nSubject: [PATCH] Fixes redirect issue\n\n---\n oauthproxy.go | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/oauthproxy.go b/oauthproxy.go\nindex 1e9bb7c..f8beb4d 100644\n--- a/oauthproxy.go\n+++ b/oauthproxy.go\n@@ -577,8 +577,9 @@ func validOptionalPort(port string) bool {\n\n // IsValidRedirect checks whether the redirect URL is whitelisted\n func (p *OAuthProxy) IsValidRedirect(redirect string) bool {\n+ matched, _ := regexp.MatchString(`^/\\s+/|\\\\`, redirect)\n switch {\n- case strings.HasPrefix(redirect, \"/\") && !strings.HasPrefix(redirect, \"//\") && !strings.HasPrefix(redirect, \"/\\\\\"):\n+ case strings.HasPrefix(redirect, \"/\") && !strings.HasPrefix(redirect, \"//\") && !matched:\n return true\n case strings.HasPrefix(redirect, \"http://\") || strings.HasPrefix(redirect, \"https://\"):\n redirectURL, err := url.Parse(redirect)\n--\n2.17.1\n```\n\nThis issue was also reported to us separately by @mik317 several hours later\n\nThe fix was implemented in [#xxx]() and released as version 5.1.1",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/oauth2-proxy/oauth2-proxy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.1.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/oauth2-proxy/oauth2-proxy/security/advisories/GHSA-j7px-6hwj-hpjg"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-11053"
}, {
"type" : "WEB",
"url" : "https://github.com/oauth2-proxy/oauth2-proxy/commit/0d5fa211df8ef2449347a56b22c779eb8d894c43"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-601" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-05-24T21:05:58Z",
"nvd_published_at" : "2020-05-07T21:15:11Z"
}
}