GHSA-6hgp-fmhr-mrg4: XSS
Impact An attacker who controls the Grid configuration can set credits.href to a javascript: URL. The value is not validated against an allowed-scheme list before it is applied to the credits link, so activating that link runs attacker-supplied script in the origin of the page hosting the Grid. Exploitation requires that untrusted data reach the Grid configuration and that a user activate the credits link. Script running this way has the same access to page data, storage and session state as the hosting application.
Workarounds Paste in after the Grid Pro module is imported, before a Grid is created.
javascript const { AST } = Grid;
function sanitize(options) { const credits = options && options.credits;
if (credits && typeof credits.href === 'string') { const filtered = AST.filterUserAttributes({ href: credits.href });
if (!filtered.href) { delete credits.href; } }
return options; }
// Both Grid.grid() and grid.update() funnel through loadUserOptions, so one // hook covers both entry points. const { prototype } = Grid.Grid; const loadUserOptions = prototype.loadUserOptions;
prototype.loadUserOptions = function (options, ...rest) { sanitize(options); return loadUserOptions.call(this, options, ...rest); };
Obtaining the patched version The patched releases are available from all the usual distribution channels. With npm, upgrade the affected package to the patched version listed above, for example npm install @highcharts/grid-lite@3.2.0. If you load Highcharts Grid from a CDN, use a versioned URL, for example https://cdn.jsdelivr.net/npm/@highcharts/grid-lite@3.2.0/grid-lite.js. For more on each installation method, see the installation guide.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/@highcharts/grid-proto a version that resolves this vulnerability.Fixed in 3.2.0 - Upgrade
Upgrade
npm/@highcharts/dashboardsto a version that resolves this vulnerability.Fixed in 4.0.0 - Upgrade
Upgrade
@highcharts/grid-liteto a version that resolves this vulnerability.Fixed in 3.2.0 - Compensating control
Install the provided loadUserOptions hook after the Grid Pro module is imported and before creating a Grid; sanitize Grid options by filtering credits.href with AST.filterUserAttributes and deleting credits.href when it is not allowed, covering both Grid.grid() and grid.update() entry points.
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using the affected Grid Pro or Dashboards packages are exposed when untrusted data can control the Grid configuration, specifically the credits.href value. A user must then activate the credits link for attacker-supplied script to run.
What can an attacker gain if exploitation succeeds?
The script executes in the origin of the page hosting the Grid. It therefore has the same access to page data, storage, and session state as the hosting application.
Is there a workaround if patching is not immediately possible?
Yes. After importing the Grid Pro module and before creating any Grid, hook Grid.Grid.prototype.loadUserOptions to sanitize credits.href with Grid.AST.filterUserAttributes and delete the value when the filtered result has no href. This covers both Grid.grid() creation and grid.update() because both use loadUserOptions.