subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
for line in result.stdout.splitlines(): if f":{port}" in line and "LISTENING" in line: pid = line.strip().split()[-1] subprocess.run( ["taskkill", "/F", "/PID", pid], capture_output=True, timeout=5 )- Confidence
- 96% confidence
- Finding
- This code force-kills whatever PID `netstat` reports as listening on the chosen port, without verifying that the process is the Chrome instance started by this tool. If the configured port is already used by another local service, the skill can terminate an unrelated application or security/control process, creating a local denial-of-service condition.
