Skip to content
Closed
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
4 changes: 2 additions & 2 deletions providers/fab/src/airflow/providers/fab/www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
def index(self):
if g.user is not None and g.user.is_authenticated:
token = get_auth_manager().generate_jwt(g.user)
response = make_response(redirect(f"{conf.get('api', 'base_url')}", code=302))
response = make_response(redirect(str(request.base_url), code=302))

Check warning

Code scanning / CodeQL

URL redirection from remote source Medium

Untrusted URL redirection depends on a
user-provided value
.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conf.get('api', 'base_url', fallback='/') here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to Pierre's comment


secure = conf.has_option("api", "ssl_cert")
response.set_cookie(COOKIE_NAME_JWT_TOKEN, token, secure=secure)

return response
return redirect(conf.get("api", "base_url", fallback="/"), code=302)
return redirect(str(request.base_url), code=302)

Check warning

Code scanning / CodeQL

URL redirection from remote source Medium

Untrusted URL redirection depends on a
user-provided value
.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you can remove this I believe



def show_traceback(error):
Expand Down