# CVE-2022-36036: Improper Control of Generation of Code ('Code Injection') in mdx-mermaid

- Severity: Low 3.6 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.40%, higher than 36% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-08-29T17:20:10.000Z
- Modified: 2026-06-17T04:52:47.327Z
- Also known as: GHSA-rvgm-35jw-q628
- Weaknesses: CWE-94
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

mdx-mermaid provides plug and play access to Mermaid in MDX. There is a potential for an arbitrary javascript injection in versions less than 1.3.0 and 2.0.0-rc1. Modify any mermaid code blocks with arbitrary code and it will execute when the component is loaded by MDXjs. This vulnerability was patched in version(s) 1.3.0 and 2.0.0-rc2. There are currently no known workarounds.

(As written by CVE List.)

## Affected

- sjwall mdx-mermaid: < 1.3.0; = 2.0.0-rc1
- mdx-mermaid (npm): before 1.3.0; from 2.0.0-rc1 before 2.0.0-rc2
- mdx-mermaid_project mdx-mermaid: from 0.0.1 before 1.3.0; 2.0.0

## Every score

- GitHub_M: CVSS:3.1 3.6 Low `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N`
- GitHub: CVSS:3.1 3.6 Low `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/sjwall/mdx-mermaid/security/advisories/GHSA-rvgm-35jw-q628> (exploit, third-party-advisory, web)
- <https://github.com/sjwall/mdx-mermaid/commit/f2b99386660fd13316823529c3f1314ebbcdfd2a> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-36036> (advisory)
- <https://github.com/sjwall/mdx-mermaid> (package)

## Sources

- CVE List: [CVE-2022-36036](https://www.cve.org/CVERecord?id=CVE-2022-36036), CVE Terms of Use, modified 2025-04-22
- GitHub Advisory Database: [GHSA-rvgm-35jw-q628](https://github.com/advisories/GHSA-rvgm-35jw-q628), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2022-36036](https://nvd.nist.gov/vuln/detail/CVE-2022-36036), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-36036 · Whole record: https://cve.day/CVE-2022-36036.json · Rebuilt by cve.day 2026-11-25T22:58:14.542Z
