github-advanced-security[bot] commented on code in PR #39925:
URL: https://github.com/apache/superset/pull/39925#discussion_r3249583132
##########
superset/views/explore.py:
##########
@@ -33,11 +35,33 @@
@permission_name("read")
@event_logger.log_this
def root(self) -> FlaskResponse:
+ # After `Superset.route_base = ""`, both `Superset.explore` and this
+ # view register at `/explore/`; this view wins. Preserve the legacy
+ # form_data → form_data_key cache-and-redirect contract here so
+ # callers passing `?form_data=...` with a datasource still get the
+ # short cache-key URL. Form_data without a datasource (e.g. legacy
+ # `slice_url` payloads carrying only `slice_id`) cannot be cached,
+ # so `get_redirect_url` would return the same URL — falling back to
+ # SPA rendering avoids a 302 loop.
+ if request_form_data := request.args.get("form_data"):
+ try:
+ parsed_form_data = loads_request_json(request_form_data)
+ except ValueError:
+ parsed_form_data = {}
+ if parsed_form_data.get("datasource"):
+ from superset.views.core import Superset # avoid circular
import
+
+ return redirect(Superset.get_redirect_url())
Review Comment:
## CodeQL / URL redirection from remote source
Untrusted URL redirection depends on a [user-provided value](1).
[Show more
details](https://github.com/apache/superset/security/code-scanning/2286)
--
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]