From cc50a7eec50da471c8d6525ca91763d188c46c8f Mon Sep 17 00:00:00 2001 From: Clement Michaud Date: Fri, 6 Dec 2019 20:34:35 +0100 Subject: [PATCH] Add a warning log when /%23/ characters are detected. --- internal/handlers/handler_verify.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/handlers/handler_verify.go b/internal/handlers/handler_verify.go index e9de683c5..5a4eba80f 100644 --- a/internal/handlers/handler_verify.go +++ b/internal/handlers/handler_verify.go @@ -240,6 +240,9 @@ func VerifyGet(ctx *middlewares.AutheliaCtx) { rd := string(ctx.QueryArgs().Peek("rd")) if rd != "" { redirectionURL := fmt.Sprintf("%s?rd=%s", rd, targetURL.String()) + if strings.Contains(redirectionURL, "/%23/") { + ctx.Logger.Warn("Characters /%23/ have been detected in redirection URL. This is not needed anymore, please strip it") + } ctx.Redirect(redirectionURL, 302) ctx.SetBodyString(fmt.Sprintf("Found. Redirecting to %s", redirectionURL)) } else {