subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
short_cmd = cmd if len(cmd) <= 50 else cmd[:47] + "..." try: result = subprocess.run( cmd, shell=True, capture_output=True,- Confidence
- 98% confidence
- Finding
- The code executes a command taken from configuration via subprocess.run(..., shell=True) after only performing a string replacement for {project_dir}. If an attacker can influence done_when.commands or related task/config input, they can execute arbitrary shell commands in the project directory, making this a real command-injection/RCE risk.
