alexandrusoare commented on code in PR #43111:
URL: https://github.com/apache/superset/pull/43111#discussion_r3811647744
##########
superset/security/manager.py:
##########
@@ -1237,7 +1393,15 @@ def query_context_modified(query_context:
"QueryContext") -> bool:
# native filter is allowed to target; other chartless paths keep prior
# behavior (see _native_filter_request_modified).
if stored_chart is None:
- return _native_filter_request_modified(query_context)
+ if _native_filter_request_modified(query_context):
+ return True
+ # Chartless non-native-filter requests (drill-to-detail, drill-by,
+ # samples) must not carry SQL extras; there is no stored chart to
+ # validate them against. Only the empty-filter sentinel is allowed.
+ sentinel_only: set[str] = {_EMPTY_FILTER_SENTINEL}
Review Comment:
Removed the chartless guard — SQL extras validation now applies only to
chart payloads (with a slice_id), which is the scope of this PR. Chartless
paths (native-filter pre-filtering, drill-to-detail, samples) are left
unchanged and remain protected by datasource-access checks in raise_for_access.
Also fixed the nits: added isinstance(flt, dict) guard in _collect_allowed_sql,
and strip trailing \n from split clauses to handle _sanitize_clause's
comment-termination behavior.
--
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]