Open Redirect in OAuth2 Proxy
cve-program · CVE-2020-5233
PublishedOAuth2 Proxy before 5.0 has an open redirect vulnerability. Authentication tokens could be silently harvested by an attacker. This has been patched in version 5.0.
Read the publisher's advisoryeuvd · EUVD-2021-2572
PublishedOAuth2 Proxy before 5.0 has an open redirect vulnerability. Authentication tokens could be silently harvested by an attacker. This has been patched in version 5.0.
Read the publisher's advisorynvd · CVE-2020-5233
PublishedOAuth2 Proxy before 5.0 has an open redirect vulnerability. Authentication tokens could be silently harvested by an attacker. This has been patched in version 5.0.
Read the publisher's advisoryosv · GHSA-qqxw-m5fj-f7gv
Published### Impact An open redirect vulnerability has been found in `oauth2_proxy`. Anyone who uses `oauth2_proxy` may potentially be impacted. For a context [detectify] have an in depth blog post about the potential impact of an open redirect. Particularly see the OAuth section. **tl;dr**: People's authentication tokens could be silently harvested by an attacker. e.g: `facebook.com/oauth.php?clientid=123&state=abc&redirect_url=https://yourdomain.com/red.php?url%3dhttps://attacker.com/` ### Patches @sauyon found the issue, and has submitted a patch. ``` diff --git a/oauthproxy.go b/oauthproxy.go index 72ab580..f420df6 100644 --- a/oauthproxy.go +++ b/oauthproxy.go @@ -517,7 +517,7 @@ func (p *OAuthProxy) GetRedirect(req *http.Request) (redirect string, err error) // IsValidRedirect checks whether the redirect URL is whitelisted func (p *OAuthProxy) IsValidRedirect(redirect string) bool { switch { - case strings.HasPrefix(redirect, "/") && !strings.HasPrefix(redirect, "//"): + case strings.HasPrefix(redirect, "/") && !strings.HasPrefix(redirect, "//") && !strings.HasPrefix(redirect, "/\\"): return true case strings.HasPrefix(redirect, "http://") || strings.HasPrefix(redirect, "https://"): redirectURL, err := url.Parse(redirect) ``` This patch will be applied to the next release, which is scheduled for when this is publicly disclosed. ### Workarounds At this stage there is no work around.
Read the publisher's advisoryAffected versions, risk and source history
Related advisories and sources
Publishers link these advisories through the identifiers shown below. A shared identifier or date alone does not tell you whether your software is affected or whether the advisories describe the same cause.
CVE-2020-5233 · CVE overview and exploitation status
cve-program · CVE-2020-5233
- https://github.com/pusher/oauth2_proxy/security/advisories/GHSA-qqxw-m5fj-f7gv
- https://github.com/pusher/oauth2_proxy/commit/a316f8a06f3c0ca2b5fc5fa18a91781b313607b2
- https://github.com/pusher/oauth2_proxy/releases/tag/v5.0.0
euvd · EUVD-2021-2572
- https://github.com/pusher/oauth2_proxy/security/advisories/GHSA-qqxw-m5fj-f7gv
- https://github.com/pusher/oauth2_proxy/commit/a316f8a06f3c0ca2b5fc5fa18a91781b313607b2
- https://github.com/pusher/oauth2_proxy/releases/tag/v5.0.0
nvd · CVE-2020-5233
- https://github.com/pusher/oauth2_proxy/commit/a316f8a06f3c0ca2b5fc5fa18a91781b313607b2
- https://github.com/pusher/oauth2_proxy/releases/tag/v5.0.0
- https://github.com/pusher/oauth2_proxy/security/advisories/GHSA-qqxw-m5fj-f7gv
osv · GHSA-qqxw-m5fj-f7gv
- https://github.com/oauth2-proxy/oauth2-proxy/security/advisories/GHSA-qqxw-m5fj-f7gv
- https://nvd.nist.gov/vuln/detail/CVE-2020-5233
- https://github.com/oauth2-proxy/oauth2_proxy/commit/a316f8a06f3c0ca2b5fc5fa18a91781b313607b2
- https://blog.detectify.com/2019/05/16/the-real-impact-of-an-open-redirect
- https://github.com/oauth2-proxy/oauth2_proxy/releases/tag/v5.0.0
Related changes
Linked by CVE identifierNo related changes are available here.