Mattermost Server OAuth Flow Cross-Site Scripting (#17743)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
364ea5ed63
Коммит
c898c3007f
@@ -4,6 +4,7 @@
|
|||||||
package web
|
package web
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"html"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@@ -384,7 +385,7 @@ func mobileLoginWithOAuth(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
redirectURL := r.URL.Query().Get("redirect_to")
|
redirectURL := html.EscapeString(r.URL.Query().Get("redirect_to"))
|
||||||
|
|
||||||
if redirectURL != "" && !utils.IsValidMobileAuthRedirectURL(c.App.Config(), redirectURL) {
|
if redirectURL != "" && !utils.IsValidMobileAuthRedirectURL(c.App.Config(), redirectURL) {
|
||||||
err := model.NewAppError("mobileLoginWithOAuth", "api.invalid_custom_url_scheme", nil, "", http.StatusBadRequest)
|
err := model.NewAppError("mobileLoginWithOAuth", "api.invalid_custom_url_scheme", nil, "", http.StatusBadRequest)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package web
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
b64 "encoding/base64"
|
b64 "encoding/base64"
|
||||||
|
"html"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -35,7 +36,7 @@ func loginWithSaml(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
action := r.URL.Query().Get("action")
|
action := r.URL.Query().Get("action")
|
||||||
isMobile := action == model.OAUTH_ACTION_MOBILE
|
isMobile := action == model.OAUTH_ACTION_MOBILE
|
||||||
redirectURL := r.URL.Query().Get("redirect_to")
|
redirectURL := html.EscapeString(r.URL.Query().Get("redirect_to"))
|
||||||
relayProps := map[string]string{}
|
relayProps := map[string]string{}
|
||||||
relayState := ""
|
relayState := ""
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user