Vulnerability · Published Nov 16, 2020 · Assigned by snyk
CVE-2020-7773Cross-site Scripting (XSS)
Medium 6.5
In plain English
A medium-severity security flaw in markdown-it-highlightjs. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 1.4% (higher than 72% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
This affects the package markdown-it-highlightjs before 3.3.1. It is possible insert malicious JavaScript as a value of lang in the markdown-it-highlightjs Inline code highlighting feature. const markdownItHighlightjs = require("markdown-it-highlightjs"); const md = require('markdown-it'); const reuslt_xss = md() .use(markdownItHighlightjs, { inline: true }) .render('console.log(42){.">js}'); console.log(reuslt_xss);
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | markdown-it-highlightjs | 3.3.1 | GHSA-f246-xrrj-g8j6 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| n/a | markdown-it-highlightjs | unspecified – before 3.3.1 |