From 0198dd6e9378405c432810e190288d796da46e4d Mon Sep 17 00:00:00 2001 From: David Stark Date: Sun, 26 Jan 2020 15:00:03 +0000 Subject: [PATCH] check for /\ redirects --- oauthproxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oauthproxy.go b/oauthproxy.go index a0195ea0..37019b48 100644 --- a/oauthproxy.go +++ b/oauthproxy.go @@ -558,7 +558,7 @@ func validOptionalPort(port string) bool { // 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)