Skip to content

Commit e688b76

Browse files
committed
Escape next_path URL in validate_referral_url
- backslashes are safe
1 parent 16bb169 commit e688b76

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

djangosaml2/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ def validate_referral_url(request, url):
110110

111111
if not url_has_allowed_host_and_scheme(url=url, allowed_hosts=saml_allowed_hosts):
112112
return get_fallback_login_redirect_url()
113-
return url
113+
114+
return urllib.parse.quote(url, safe="/")
114115

115116

116117
def saml2_from_httpredirect_request(url):

0 commit comments

Comments
 (0)