subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
cmd_str = f'git clone --depth {config.clone_depth} "{clone_url}" "{target_dir}"' print(f"{Colors.INFO}执行命令: {cmd_str}") result = subprocess.run( cmd_str, capture_output=True, text=True, timeout=config.timeout, shell=True )- Confidence
- 99% confidence
- Finding
- The script builds a shell command string containing user-influenced repository URL data and filesystem paths, then executes it with shell=True. This enables command injection if an attacker can influence clone_url or target_dir formatting, and the risk is amplified because this skill is specifically designed to process arbitrary repositories supplied by users.
