markdown-it-prism@1.1.0 vulnerabilities

Highlights code blocks in markdown-it using Prism.

Direct Vulnerabilities

Known vulnerabilities in the markdown-it-prism package. This does not include vulnerabilities belonging to this package’s dependencies.

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • M
Cross-site Scripting (XSS)

markdown-it-prism is a The plugin will insert the necessary markup into all code blocks. Include one of Prism’s stylesheets in your HTML to get highlighted code.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS). It is possible to insert malicious JavaScript as markup to the package which will be returned unsanitised.

PoC

public class Foo() {
    public Foo(bar) {
        System.out.println(bar);
    }
}

How to fix Cross-site Scripting (XSS)?

Upgrade markdown-it-prism to version 2.1.3 or higher.

<2.1.3