Vulnerabilities/

Improper Control of Generation of Code ('Code Injection') in mdx-mermaid

Severity:
Low

Description

Arbitary javascript injection

Modify any mermaid code blocks with the following code and the code inside will execute when the component is loaded by MDXjs

The block below shows a valid mermaid code block

mermaid graph TD; A–>B; A–>C; B–>D; C–>D; `

The same block but with the exploit added

mermaid ` + (function () { alert

Recommendation

Update the mdx-mermaid package to the latest compatible version. Followings are version details:

References

Related Issues

Tags:
npm
mdx-mermaid
Anything's wrong? Let us know Last updated on January 29, 2023