Skip to content

Options structure open to Cross-site Scripting if passed unfiltered

High severity GitHub Reviewed Published May 5, 2021 in highcharts/highcharts • Updated Jan 29, 2023

Package

npm highcharts (npm)

Affected versions

< 9.0.0

Patched versions

9.0.0

Description

Impact

In Highcharts versions 8 and earlier, the chart options structure was not systematically filtered for XSS vectors. The potential impact was that content from untrusted sources could execute code in the end user's browser. Especially when using the useHTML flag, HTML string options would be inserted unfiltered directly into the DOM. When useHTML was false, malicious code could be inserted by using various character replacement tricks or malformed HTML.

If your chart configuration comes from a trusted source like a static setup or pre-filtered HTML (or no markup at all in the configuration), you are not impacted.

Patches

In version 9, the whole rendering layer was refactored to use an DOMParser, an AST and tag and HTML allow-listing to make sure only safe content entered the DOM. In addition, prototype pollution was stopped.

Workarounds

Implementers who are not able to upgrade may apply DOMPurify recursively to the options structure to filter out malicious markup.

References

For more information

If you have any questions or comments about this advisory:

References

@TorsteinHonsi TorsteinHonsi published to highcharts/highcharts May 5, 2021
Reviewed May 5, 2021
Published by the National Vulnerability Database May 5, 2021
Published to the GitHub Advisory Database May 6, 2021
Last updated Jan 29, 2023

Severity

High
7.6
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
Low
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:L

Weaknesses

CVE ID

CVE-2021-29489

GHSA ID

GHSA-8j65-4pcq-xq95

Source code

Checking history
See something to contribute? Suggest improvements for this vulnerability.