Advisory

GHSA-f246-xrrj-g8j6

Also known as: CVE-2020-7773, SNYK-JS-MARKDOWNITHIGHLIGHTJS-1040461

Summary

Cross-site Scripting in markdown-it-highlightjs

Details

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);

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2022-02-10 20:19 UTC
Modified
2026-07-08 06:49 UTC

Affected packages and fixes

markdown-it-highlightjs

npm · All systems

Affected

  • introduced 0, fixed 3.3.1 (semver)

Fixed versions

3.3.1

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences