GHSA-f246-xrrj-g8j6

Suggest an improvement
Source
https://github.com/advisories/GHSA-f246-xrrj-g8j6
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/02/GHSA-f246-xrrj-g8j6/GHSA-f246-xrrj-g8j6.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-f246-xrrj-g8j6
Aliases
Published
2022-02-10T20:19:47Z
Modified
2025-01-08T07:43:47.653494Z
Severity
  • 6.1 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N CVSS Calculator
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);
Database specific
{
    "nvd_published_at": "2020-11-16T12:15:00Z",
    "cwe_ids": [
        "CWE-79"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2021-04-15T21:12:47Z"
}
References

Affected packages

npm / markdown-it-highlightjs

Package

Name
markdown-it-highlightjs
View open source insights on deps.dev
Purl
pkg:npm/markdown-it-highlightjs

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.3.1