subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: # Mermaid CLI 실행 result = subprocess.run([ 'npx', '-y', '@mermaid-js/mermaid-cli', '-i', mmd_file, '-o', str(output_file),- Confidence
- 89% confidence
- Finding
- The code invokes an external toolchain via `npx -y @mermaid-js/mermaid-cli` on untrusted Mermaid content. Even though `shell=False` avoids classic shell injection, this still expands the attack surface to a Node-based renderer and a package fetched/executed through `npx`, which can expose the host to parser/renderer vulnerabilities or unexpected network/package-supply-chain behavior.
