subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def _chrome_kill_port_pids(port=DEFAULT_CDP_PORT): """释放调试端口(macOS/Linux:lsof + kill)。""" try: r = subprocess.run( ["lsof", "-ti", f":{port}"], capture_output=True, text=True,- Confidence
- 95% confidence
- Finding
- This code enumerates all PIDs bound to the chosen port and is later used to terminate them, without validating that the process is actually the intended Chrome instance. In this skill context, a user-supplied --port means the script can disrupt unrelated local services if the chosen port is in use.
