bito-code-review[bot] commented on PR #44365:
URL: https://github.com/apache/superset/pull/44365#issuecomment-5705819039

   <!-- Bito Reply -->
   The code implements a secure mechanism for one-time login tokens, which 
includes a validation check for the `next` URL parameter to prevent open 
redirection vulnerabilities. In the `login_with_token` method within 
`superset/security/api.py`, the `next` URL is explicitly validated using 
`is_safe_redirect_url(next_url)` before performing the redirect. If the URL is 
deemed unsafe, the application defaults to redirecting to the root path (`/`). 
This approach ensures that the redirection is restricted to internal URLs, 
mitigating the risk of untrusted URL redirection.
   
   **superset/security/api.py**
   ```
   next_url = request.args.get("next") or "/"
           if not is_safe_redirect_url(next_url):
               logger.warning("Rejected unsafe `next` on login-token consume")
               next_url = "/"
   
           return redirect(next_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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to