CVE-2021-29489: Cross-site Scripting Vulnerability in highcharts
Summary
CVE-2021-29489: Options structure open to Cross-site Scripting if passed unfiltered. Affects highcharts versions < 9.0.0. Fixed in 9.0.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Highcharts is a popular JavaScript charting library used for creating interactive and visually appealing charts on web pages. It provides a wide range of chart types and customization options, making it a versatile tool for data visualization. However, versions 8 and earlier of Highcharts were found to be vulnerable to a Cross-site Scripting (XSS) attack. This vulnerability allowed untrusted sources to inject malicious code into the end user's browser, potentially leading to unauthorized access or data theft.
Vulnerability Detail
The vulnerability in Highcharts versions 8 and earlier stemmed from the lack of systematic filtering of the chart options structure for XSS vectors. When the 'useHTML' flag was enabled, HTML string options were inserted into the DOM without proper filtering, allowing malicious code execution. Even when 'useHTML' was disabled, attackers could exploit character replacement tricks or malformed HTML to insert malicious code. The impact of this vulnerability could be severe, as it allowed attackers to execute arbitrary code in the context of the user's browser.
How To Fix
Latest published version: 13.1.1 as of 23 Oct 2026
npm install highcharts@13.1.1
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
9.0.0
This is the first release that contains the fix.
npm install highcharts@9.0.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to version 9 is not feasible, implementers can apply the DOMPurify library recursively to the options structure to filter out malicious markup. DOMPurify is a widely-used library for sanitizing HTML and preventing XSS attacks. Here is an example of how to use DOMPurify with Highcharts options structure: [code snippet]
Conclusion
The Cross-site Scripting vulnerability in Highcharts versions 8 and earlier posed a significant risk to web applications using this library for charting. However, the Highcharts team addressed this issue in version 9 by implementing robust filtering mechanisms and fixing prototype pollution. Users are strongly advised to upgrade to the latest version to ensure the security of their applications. If upgrading is not possible, applying the DOMPurify library can serve as a temporary workaround. For further support and assistance in vulnerability remediation, please contact security@highcharts.com.
See every vulnerability recorded for highcharts →
FAQ
The vulnerability allowed untrusted sources to execute arbitrary code in the user's browser, potentially leading to unauthorized access or data theft.
To fix this vulnerability, upgrade to Highcharts version 9 or later. Alternatively, you can apply the DOMPurify library to filter out malicious markup.
If your chart configuration comes from a trusted source or is pre-filtered, you are not affected by this vulnerability.
Implementers who cannot upgrade to version 9 can use the DOMPurify library to filter out malicious markup as a workaround.
You can find more information about Highcharts security on their website and by contacting their support team.
Related vulnerabilities
Recent vulnerabilities recorded for highcharts.