subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
print(f"Command: {' '.join(cmd)}") try: result = subprocess.run( cmd, capture_output=True, text=True,- Confidence
- 92% confidence
- Finding
- This subprocess execution uses a command derived from the user-controllable --mermaid-cmd option via mermaid_cmd.split(), allowing a caller to choose an arbitrary executable and arguments. Although shell=True is not used, an attacker can still cause execution of unintended local programs, which is dangerous in an agent skill context where tool parameters may be influenced by upstream prompts or untrusted inputs. The skill also renders untrusted Mermaid content through mermaid-cli/Puppeteer, increasing exposure to downstream renderer or browser bugs.
