Skip to content

fix(legacy-plugin-chart-partition): prevent stored XSS in tooltip - #6

Open
sha174n wants to merge 4 commits into
masterfrom
fix-legacy-partition-chart-xss-15948119334882233987
Open

sha174n wants to merge 4 commits into
masterfrom
fix-legacy-partition-chart-xss-15948119334882233987

Conversation

@sha174n

@sha174n sha174n commented Feb 11, 2026

Copy link
Copy Markdown
Owner

This PR fixes a stored XSS vulnerability in the legacy Partition chart plugin. The vulnerability allowed malicious scripts injected into dimension values to execute when a user hovered over the chart segments.

I have verified the fix with a new regression test superset-frontend/plugins/legacy-plugin-chart-partition/test/Partition.test.ts which reproduces the issue and confirms the fix (asserting escaped HTML output).

I also had to update superset-frontend/jest.config.js to allow d3-hierarchy (a dependency of the plugin) to be processed by Jest, as it is distributed as an ES module. This was necessary to run the tests for this plugin.


PR created automatically by Jules for task 15948119334882233987 started by @sha174n

… stored XSS

This change addresses a reported stored XSS vulnerability in the legacy Partition chart. User-controlled values (metrics and dimension names) were being interpolated directly into the tooltip HTML without sanitization.

Changes:
- Implemented `escapeHtml` helper function in `Partition.ts`.
- Updated `positionAndPopulate` function to escape `n.name`, `n.disp`, `d.name`, `d.disp`, and category labels before inserting them into the tooltip.
- Added a regression test `Partition.test.ts` that verifies the fix by asserting that an XSS payload is properly escaped.
- Updated `jest.config.js` to include `d3-hierarchy` in `transformIgnorePatterns` to allow Jest to transform the ES module used by the plugin, enabling the new test to run.

Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 3 commits February 11, 2026 16:03
- Fix Stored XSS in legacy Partition chart by HTML-escaping user-controlled tooltip values.
- Add regression test `Partition.test.ts`.
- Update `package.json` overrides for `core-js` (to ^3.48.0) and `@noble/hashes` (to ^1.8.0) to resolve conflicts with `superset-ui-core` and other deps.
- Update `package-lock.json` via `npm install` to sync with new overrides and fix CI `npm ci` failures.
- Update `jest.config.js` to whitelist `d3-hierarchy` for transformation.

Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
…scape

Refactors the tooltip HTML generation to sanitize user-controlled values (metrics, dimensions) using `lodash.escape`.
Also fixes CI build issues by updating `superset-frontend/package.json` overrides and synchronizing `package-lock.json`.
Adds a regression test in `superset-frontend/plugins/legacy-plugin-chart-partition/test/Partition.test.ts`.

Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
…scape

Refactors the tooltip HTML generation to sanitize user-controlled values (metrics, dimensions) using `lodash.escape`.
Also fixes CI build issues by updating `superset-frontend/package.json` overrides and synchronizing `package-lock.json`.
Adds a regression test in `superset-frontend/plugins/legacy-plugin-chart-partition/test/Partition.test.ts`.

Co-authored-by: sha174n <105581038+sha174n@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant