markdown-it-toc@1.1.0 vulnerabilities

Adds syntax for an automatically generated table of contents to markdown-it markdown parser.

Direct Vulnerabilities

Known vulnerabilities in the markdown-it-toc 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
  • H
Cross-site Scripting (XSS)

markdown-it-toc is an Adds syntax for an automatically generated table of contents to markdown-it markdown parser.

Affected versions of this package are vulnerable to Cross-site Scripting (XSS). The title of the generated toc and the contents of the header are not escaped.

PoC

// XSS from the header string
result = md.render(`
@[toc](Title)

# head">alert(2)
`)

console.log(result);

How to fix Cross-site Scripting (XSS)?

There is no fixed version for markdown-it-toc.

*