subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
server_ip = "服务器IP" for service in ip_services: try: result = subprocess.run(['curl', '-s', '--connect-timeout', '3', service], capture_output=True, text=True) if result.returncode == 0 and result.stdout.strip(): server_ip = result.stdout.strip() break- Confidence
- 93% confidence
- Finding
- The script spawns an external curl process to contact third-party IP lookup services during a backup operation, which is not required for creating a local archive. This adds unnecessary command execution and outbound network behavior, increasing attack surface and creating privacy/integrity risks if a service returns unexpected content or if curl is unavailable/aliased in the execution environment.
