subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
print("Rendering organizational chart to PNG...") org_chart_png_path = f"{output_dir}/org_chart.png" try: subprocess.run(["manus-render-diagram", org_chart_mermaid_path, org_chart_png_path], check=True) print(f"Organizational chart rendered to {org_chart_png_path}") except subprocess.CalledProcessError as e: print(f"Error rendering organizational chart: {e}")- Confidence
- 83% confidence
- Finding
- The code passes a path derived from the function parameter `output_dir` into an external executable, `manus-render-diagram`, and also feeds it Mermaid content generated from prompt-derived agent data. While there is no shell injection because arguments are passed as a list, invoking an external renderer on untrusted, generated diagram content expands the attack surface to any parser/renderer flaws in that tool and allows arbitrary file writes within the chosen output path.
