os.system() or os exec-family call
High
- Category
- Dangerous Code Execution
- Content
elif command == "mcp": # 启动 MCP 服务器 os.system(f"python {Path(__file__).parent}/mcp_server.py {' '.join(sys.argv[2:])}") elif command == "test": # 运行测试- Confidence
- 99% confidence
- Finding
- The `mcp` command builds a shell command with `os.system(...)` and directly concatenates `sys.argv[2:]` via `' '.join(...)`. Because these arguments are user-controlled and not quoted or passed as a safe argument vector, an attacker can inject shell metacharacters and execute arbitrary commands on the host.
