Intel

AIKIDO-2024-10036

markdown-it is vulnerable to Cross-site Scripting (XSS)

Cross-site Scripting (XSS) Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Apr 22, 2024

45

Medium Risk

This Affects:

JSmarkdown-it
4.0.0 - 4.3.0
Fixed in 4.3.1
Are you affected? Scan for Free

TL;DR

Affected versions of the package are vulnerable to Cross-site Scripting (XSS) through class injection. The markdown-it renderer (lib/renderer.js:36) appends the character class to the language- part of the tag without proper validation, allowing an attacker to inject any class into the code tag.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

markdown-it is vulnerable to Cross-site Scripting (XSS) in versions 4.0.0 - 4.3.0.

How to fix this

Upgrade the markdown-it library to the patch version.