You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/06/02 01:03:59 UTC
(superset) 01/01: fix(dashboard): URL-encode native_filters in permalink redirect
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch fix/permalink-native-filters-encoding
in repository https://gitbox.apache.org/repos/asf/superset.git
commit e1d94c0a5619b5462e1266a733db24217f5dc059
Author: Claude Code <no...@anthropic.com>
AuthorDate: Mon Jun 1 18:03:39 2026 -0700
fix(dashboard): URL-encode native_filters in permalink redirect
dashboard_permalink concatenated the native_filters param value into the
redirect URL without URL-encoding (every other param went through
parse.urlencode). A permalink whose stored native_filters value contained
'&'/'#'/'=' could inject additional query parameters into the redirect target,
modifying the dashboard filter state shown to a victim.
Encode all param values uniformly; Flask decodes them back on read, so
legitimate native_filters values are unaffected.
Co-Authored-By: Claude Opus 4.8 <no...@anthropic.com>
---
superset/views/core.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/superset/views/core.py b/superset/views/core.py
index c4c16cb65fd..2a5d66cf4cb 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -864,12 +864,11 @@ class Superset(BaseSupersetView):
)
if url_params := state.get("urlParams"):
for param_key, param_val in url_params:
- if param_key == "native_filters":
- # native_filters doesnt need to be encoded here
- url = f"{url}&native_filters={param_val}"
- else:
- params = parse.urlencode([(param_key, param_val)])
- url = f"{url}&{params}"
+ # URL-encode every param value (including native_filters) so a
+ # value containing '&'/'#'/'=' cannot inject extra parameters
+ # into the redirect target. Flask decodes the value back on read.
+ params = parse.urlencode([(param_key, param_val)])
+ url = f"{url}&{params}"
if original_params := request.query_string.decode():
url = f"{url}&{original_params}"
if hash_ := state.get("anchor", state.get("hash")):