Cross-site Scripting (XSS) Affecting org.webjars.npm:markdown-it package, versions [4.0.0,4.3.1)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JAVA-ORGWEBJARSNPM-479890
  • published13 Feb 2017
  • disclosed1 Jul 2015
  • creditAlex Kocharin

Introduced: 1 Jul 2015

CVE NOT AVAILABLE CWE-79  (opens in a new tab)

How to fix?

Upgrade markdown-it to version 4.3.1 or higher.

Overview

markdown-it is a modern pluggable markdown parser.

Affected versions of the package are vulnerable to Cross-site Scripting (XSS) via Class Injection.

The markdown-it renderer blindly appends the character class to the language- part of the tag. If there is a space in the language name, it'll be rendered into two separate classes.

\`\`\`
foo bar
code
\`\`\`

will be rendered into

<pre><code style="language-foo bar">
code
</code></pre>

A malicious user can attach an arbitrary class to the code tag.

Details

<>

CVSS Scores

version 3.1