0x000A commented on code in PR #76362:
URL: https://github.com/apache/airflow/pull/76362#discussion_r4453637749
##########
providers/keycloak/src/airflow/providers/keycloak/auth_manager/routes/login.py:
##########
@@ -128,7 +144,11 @@
token = get_auth_manager().generate_jwt(user)
request.state.jwt_token_issued = True
- response = RedirectResponse(url=conf.get("api", "base_url", fallback="/"),
status_code=303)
+ redirect_url = conf.get("api", "base_url", fallback="/")
+ next_url = request.cookies.get(COOKIE_NAME_LOGIN_NEXT_URL)
+ if next_url and is_safe_url(next_url, request=request):
+ redirect_url = next_url
+ response = RedirectResponse(url=redirect_url, status_code=303)
Review Comment:
Looks like a false positive. The target URL is checked with `is_safe_url`
both when it's saved and before the redirect, the same check
`SimpleAuthManager` uses and anything unsafe falls back to `[api] base_url`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]