subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
if len(parts) >= 2: return int(parts[1].strip('"')) else: result = subprocess.run( ["pgrep", "-f", process_name], capture_output=True, text=True,- Confidence
- 81% confidence
- Finding
- This code passes `process_name` into `pgrep -f`, which matches against the full command line and can return unrelated processes whose arguments contain that substring. In this skill, that broad matching feeds into stop/kill logic, so a crafted or overly generic process name could lead to termination of the wrong process.
