Skip to content

Commit

Permalink
Fix localhost detection for URL redirect protection (#5293)
Browse files Browse the repository at this point in the history
  • Loading branch information
evankanderson authored Jan 13, 2025
1 parent 9b2ecaa commit ac4f2fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/controlplane/handlers_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (s *Server) alllowedRedirectURL(redirectUrl *url.URL) bool {
if redirectUrl == nil || redirectUrl.String() == "" {
return true // Empty URL is allowed
}
if redirectUrl.Host == "localhost" {
if redirectUrl.Hostname() == "localhost" {
return true
}
hostUrl, err := redirectUrl.Parse("/")
Expand Down

0 comments on commit ac4f2fc

Please sign in to comment.