git.iko.soy/typeable/oauth2-proxy
on master help sign in
Don't log invalid redirect if redirect is empty
commitdc756b9de33e7e87f6e134f7cfd10455d2a9fbb8 authorJoel Speed <joel.speed@hotmail.co.uk> dateSun 31 May 2020, 15:32 (6 years ago) parent713c392
2 files changed+4
CHANGELOG.md+1 oauthproxy.go+3
CHANGELOG.md+1
@@ -56,6 +56,7 @@
5656## Changes since v5.1.1
5757
5858- [#620](https://github.com/oauth2-proxy/oauth2-proxy/pull/620) Add HealthCheck middleware (@JoelSpeed)
59+- [#597](https://github.com/oauth2-proxy/oauth2-proxy/pull/597) Don't log invalid redirect if redirect is empty (@JoelSpeed)
5960- [#604](https://github.com/oauth2-proxy/oauth2-proxy/pull/604) Add Keycloak local testing environment (@EvgeniGordeev)
6061- [#539](https://github.com/oauth2-proxy/oauth2-proxy/pull/539) Refactor encryption ciphers and add AES-GCM support (@NickMeves)
6162- [#601](https://github.com/oauth2-proxy/oauth2-proxy/pull/601) Ensure decrypted user/email are valid UTF8 (@JoelSpeed)
oauthproxy.go+3
@@ -598,6 +598,9 @@ func validOptionalPort(port string) bool {
598598// IsValidRedirect checks whether the redirect URL is whitelisted
599599func (p *OAuthProxy) IsValidRedirect(redirect string) bool {
600600 switch {
601+ case redirect == "":
602+ // The user didn't specify a redirect, should fallback to `/`
603+ return false
601604 case strings.HasPrefix(redirect, "/") && !strings.HasPrefix(redirect, "//") && !invalidRedirectRegex.MatchString(redirect):
602605 return true
603606 case strings.HasPrefix(redirect, "http://") || strings.HasPrefix(redirect, "https://"):