You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org> on 2025/03/12 14:30:47 UTC

Re: [PR] Set JWT token to localStorage from cookies [airflow]

github-advanced-security[bot] commented on code in PR #47432:
URL: https://github.com/apache/airflow/pull/47432#discussion_r1991632253


##########
providers/fab/src/airflow/providers/fab/www/views.py:
##########
@@ -70,7 +71,9 @@
     def index(self):
         if g.user is not None and g.user.is_authenticated:
             token = get_auth_manager().get_jwt_token(g.user)
-            return redirect(urljoin(conf.get("api", "base_url"), f"?token={token}"), code=302)
+            response = make_response(redirect(f"{conf.get('api', 'base_url')}", code=302))
+            response.set_cookie("_token", token)

Review Comment:
   ## Failure to use secure cookies
   
   Cookie is added without the Secure and HttpOnly attributes properly set.
   
   [Show more details](https://github.com/apache/airflow/security/code-scanning/393)



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org