Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yuriisanin opened this issue Nov 22, 2022 · 1 comment
Open

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

yuriisanin opened this issue Nov 22, 2022 · 1 comment

Comments

@yuriisanin
Copy link

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,
      },
    );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant