CVE-2021-29489: Highcharts Cross-Site Scripting Vulnerability
HIGHCVE-2021-29489 is a HIGH (CVSS 7.6) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Highcharts libraries in the npm ecosystem. The issue involves options structure open to cross-site scripting if passed unfiltered. Remediation is available by upgrading affected packages to version 9.0.0.
CVE-2021-29489 at a Glance
Security Impact
CVSS: 7.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:L).
How to Fix CVE-2021-29489
To remediate this vulnerability, upgrade all affected Highcharts dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install highcharts@9.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls highcharts
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-29489, inspect your project dependencies using npm:
npm ls highcharts
Analyze the terminal output to locate any version of Highcharts in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.0.0), your application is affected.
Note: The npm ls highcharts command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Highcharts, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-29489 Affected Highcharts Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
highcharts
|
npm |
< 9.0.0
|
9.0.0
|
References
Frequently Asked Questions
What is CVE-2021-29489?
Which Highcharts versions are affected?
What version fixes CVE-2021-29489?
Is highcharts affected?
What is the CVSS score of CVE-2021-29489?
What CWE is associated with CVE-2021-29489?
How can I check npm dependencies for CVE-2021-29489?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8j65-4pcq-xq95",
"modified" : "2022-06-06T18:17:02Z",
"published" : "2021-05-06T15:45:03Z",
"aliases" : [ "CVE-2021-29489" ],
"summary" : "Options structure open to Cross-site Scripting if passed unfiltered",
"details" : "### Impact\nIn 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.\n\nIf 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.\n\n### Patches\nIn 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.\n\n### Workarounds\nImplementers who are not able to upgrade may apply [DOMPurify](https://github.com/cure53/DOMPurify) recursively [to the options structure](https://jsfiddle.net/highcharts/zd3wcm5L/) to filter out malicious markup.\n\n### References\n* Details on the improved [Highcharts security](https://www.highcharts.com/docs/chart-concepts/security)\n* [The AST and TextBuilder refactoring](https://github.com/highcharts/highcharts/pull/14913)\n* [The fix for prototype pollution](https://github.com/highcharts/highcharts/pull/14884)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Visit our [support page](https://www.highcharts.com/blog/support/)\n* For more Email us at [security@highcharts.com](mailto:security@highcharts.com)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "highcharts"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "9.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/highcharts/highcharts/security/advisories/GHSA-8j65-4pcq-xq95"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-29489"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/highcharts/highcharts"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20210622-0005"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/package/highcharts"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-05-05T15:37:11Z",
"nvd_published_at" : "2021-05-05T16:15:00Z"
}
}