subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_mcporter(command: str) -> Dict[str, Any]: """执行 mcporter 命令并返回解析后的 JSON""" try: result = subprocess.run( command, shell=True, capture_output=True,- Confidence
- 99% confidence
- Finding
- The code passes a dynamically constructed string into subprocess.run with shell=True, which enables shell metacharacter interpretation. Because _call interpolates tool names and kwargs directly into the command string, attacker-controlled values can break out of the intended mcporter invocation and execute arbitrary shell commands.
