subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_command(cmd, shell=False): """执行命令并返回输出""" try: result = subprocess.run( cmd, shell=shell, capture_output=True,- Confidence
- 94% confidence
- Finding
- The helper permits subprocess execution with shell=True, and this script actually uses that mode in check_installed_tools() for command strings containing pipes and shell parsing. While the current commands are hardcoded rather than user-controlled, enabling shell execution creates an unnecessary command-injection surface if any future input, environment-derived value, or modified tool check is incorporated into those strings.
