Low, CVSS 3.6npmAmendedPublished
Improper Control of Generation of Code ('Code Injection') in mdx-mermaid
CVE-2022-36036 · GHSA-rvgm-35jw-q628
- Affected
- npm mdx-mermaid < 1.3.0; >= 2.0.0-rc1, <= 2.0.0-rc1
- Fixed in
- 1.3.02.0.0-rc2· Vendor fix available
- Issue
- Impact 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('vulnerable') return '' }()) + graph TD; A--B; A--C; B--D; C--D; Patches 1.3.0 and 2.0.0-rc2 Workarounds None known
Recommended action: Upgrade to 2.0.0-rc2 (pre-release) or 1.3.0 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.