Skip to content

Commit 0a2c2aa

Browse files
committed
Merge branch 'rbren/patch-1' into master
2 parents ecd0e44 + 7d0371e commit 0a2c2aa

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

defaults/responder.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ func (r *Redirector) Redirect(w http.ResponseWriter, req *http.Request, ro authb
7777
func (r Redirector) redirectAPI(w http.ResponseWriter, req *http.Request, ro authboss.RedirectOptions) error {
7878
path := ro.RedirectPath
7979
redir := req.FormValue(r.FormValueName)
80+
if strings.Contains(redir, "://") {
81+
// Guard against Open Redirect: https://cwe.mitre.org/data/definitions/601.html
82+
redir = ""
83+
}
8084
if len(redir) != 0 && ro.FollowRedirParam {
8185
path = redir
8286
}

0 commit comments

Comments
 (0)