Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLWYyNDYteHJyai1nOGo2
Cross-site Scripting in markdown-it-highlightjs
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);
Permalink: https://github.com/advisories/GHSA-f246-xrrj-g8j6JSON: https://advisories.ecosyste.ms/api/v1/advisories/MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLWYyNDYteHJyai1nOGo2
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: about 2 years ago
Updated: 8 months ago
CVSS Score: 6.1
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Identifiers: GHSA-f246-xrrj-g8j6, CVE-2020-7773
References:
- https://nvd.nist.gov/vuln/detail/CVE-2020-7773
- https://github.com/valeriangalliat/markdown-it-highlightjs/pull/14
- https://github.com/valeriangalliat/markdown-it-highlightjs/blob/v3.3.0/index.js%23L52
- https://snyk.io/vuln/SNYK-JS-MARKDOWNITHIGHLIGHTJS-1040461
- https://github.com/advisories/GHSA-f246-xrrj-g8j6
Blast Radius: 20.0
Affected Packages
npm:markdown-it-highlightjs
Dependent packages: 161Dependent repositories: 1,933
Downloads: 75,366 last month
Affected Version Ranges: < 3.3.1
Fixed in: 3.3.1
All affected versions: 1.0.0, 1.1.0, 1.1.1, 1.1.2, 2.0.0, 3.0.0, 3.1.0, 3.2.0, 3.3.0
All unaffected versions: 3.3.1, 3.4.0, 3.5.0, 3.6.0, 4.0.0, 4.0.1