Skip to content

[Vulnerability] OS command injection via Memraid PNG export #274

@yuriisanin

Description

@yuriisanin

The Memraid PNG export functionality is vulnerable to OS command injection due to use of shell option enabled. This could allow an attacker to injection OS command using pngFilePath variable.

File: mermaid.ts (lines: 23-40)

Vulnerable code snippet:

await utility.execFile(
      "npx",
      [
        "-p",
        "@mermaid-js/mermaid-cli",
        "mmdc",
        "--theme",
        themeName,
        "--input",
        info.path,
        "--output",
        pngFilePath,
      ],
      {
        shell: true,
        cwd: projectDirectoryPath,
      },
    );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions