From d3b5edacb655ced0135ca5f48544612ccc38890e Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 28 Aug 2020 05:37:05 +0100 Subject: Escape more things that are passed through str2html (#12622) * Escape more things that are passed through str2html Signed-off-by: Andrew Thornton * Bloody editors! Co-authored-by: mrsdizzie * Update routers/user/oauth.go Co-authored-by: mrsdizzie Co-authored-by: techknowlogick --- routers/user/oauth.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'routers') diff --git a/routers/user/oauth.go b/routers/user/oauth.go index a9e089b39f..12665e94db 100644 --- a/routers/user/oauth.go +++ b/routers/user/oauth.go @@ -7,6 +7,7 @@ package user import ( "encoding/base64" "fmt" + "html" "net/url" "strings" @@ -271,8 +272,8 @@ func AuthorizeOAuth(ctx *context.Context, form auth.AuthorizationForm) { ctx.Data["Application"] = app ctx.Data["RedirectURI"] = form.RedirectURI ctx.Data["State"] = form.State - ctx.Data["ApplicationUserLink"] = "@" + app.User.Name + "" - ctx.Data["ApplicationRedirectDomainHTML"] = "" + form.RedirectURI + "" + ctx.Data["ApplicationUserLink"] = "@" + html.EscapeString(app.User.Name) + "" + ctx.Data["ApplicationRedirectDomainHTML"] = "" + html.EscapeString(form.RedirectURI) + "" // TODO document SESSION <=> FORM err = ctx.Session.Set("client_id", app.ClientID) if err != nil { -- cgit v1.2.3