mirror of
https://github.com/apache/superset.git
synced 2026-08-05 05:22:37 +00:00
fix(drilldetail): sanitize explore URL before navigation
CodeQL flagged a DOM-XSS taint path (js/xss-through-dom) from DashboardPageIdContext into window.location.href via generateExploreUrl. Wrap the generated URL in sanitizeUrl(), matching the existing convention used elsewhere for window.location.href assignments (e.g. ResultSet, SaveDatasetModal, navigationUtils). Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
import { useContext, useMemo, useState } from 'react';
|
||||
import { sanitizeUrl } from '@braintree/sanitize-url';
|
||||
import {
|
||||
BinaryQueryObjectFilterClause,
|
||||
css,
|
||||
@@ -171,7 +172,7 @@ export default function DrillDetailModal({
|
||||
},
|
||||
);
|
||||
|
||||
window.location.href = url;
|
||||
window.location.href = sanitizeUrl(url);
|
||||
} catch (error) {
|
||||
console.error('Failed to generate chart explore URL:', error);
|
||||
addDangerToast(t('Failed to generate chart explore URL'));
|
||||
|
||||
Reference in New Issue
Block a user