Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion install/docker/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ def login(self):
if user:
login_user(user, remember=True)
if comed_url:
return redirect(comed_url)
# 仅开放同域名跳转,避免开放式URL重定向漏洞
from werkzeug.urls import url_parse
parsed_url = url_parse(comed_url)
if (not parsed_url.netloc and parsed_url.path) or parsed_url.netloc == request.host:
return redirect(comed_url)
return redirect(self.appbuilder.get_url_for_index)
# 如果已经登录了,那么直接进去首页
if g.user is not None and g.user.is_authenticated:
Expand Down
6 changes: 5 additions & 1 deletion install/kubernetes/cube/overlays/config/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ def login(self):
if user:
login_user(user, remember=True)
if comed_url:
return redirect(comed_url)
# 仅开放同域名跳转,避免开放式URL重定向漏洞
from werkzeug.urls import url_parse
parsed_url = url_parse(comed_url)
if (not parsed_url.netloc and parsed_url.path) or parsed_url.netloc == request.host:
return redirect(comed_url)
return redirect(self.appbuilder.get_url_for_index)
# 如果已经登录了,那么直接进去首页
if g.user is not None and g.user.is_authenticated:
Expand Down
6 changes: 5 additions & 1 deletion myapp/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ def login(self):
if user:
login_user(user, remember=True)
if comed_url:
return redirect(comed_url)
# 仅开放同域名跳转,避免开放式URL重定向漏洞
from werkzeug.urls import url_parse
parsed_url = url_parse(comed_url)
if (not parsed_url.netloc and parsed_url.path) or parsed_url.netloc == request.host:
return redirect(comed_url)
return redirect(self.appbuilder.get_url_for_index)

if g.user is not None and g.user.is_authenticated:
Expand Down