github-advanced-security[bot] commented on code in PR #55506:
URL: https://github.com/apache/airflow/pull/55506#discussion_r2394866328
##########
providers/fab/src/airflow/providers/fab/www/views.py:
##########
@@ -70,8 +71,13 @@
token = get_auth_manager().generate_jwt(g.user)
response = make_response(redirect(f"{conf.get('api', 'base_url',
fallback='/')}", code=302))
- secure = bool(conf.get("api", "ssl_cert", fallback=""))
- response.set_cookie(COOKIE_NAME_JWT_TOKEN, token, secure=secure)
+ secure = request.scheme == "https" or bool(conf.get("api",
"ssl_cert", fallback=""))
+ # In Airflow 3.2 authentication changes, front-end no longer
handle the token
+ # See https://github.com/apache/airflow/pull/55506
+ if AIRFLOW_V_3_2_PLUS:
+ response.set_cookie(COOKIE_NAME_JWT_TOKEN, token,
secure=secure, httponly=True)
+ else:
+ response.set_cookie(COOKIE_NAME_JWT_TOKEN, token,
secure=secure)
Review Comment:
## Failure to use secure cookies
Cookie is added without the HttpOnly attribute properly set.
[Show more
details](https://github.com/apache/airflow/security/code-scanning/535)
--
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]