subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def find_traceroute(): for path in ["/usr/sbin/traceroute", "/sbin/traceroute", "/usr/bin/traceroute", "traceroute"]: try: subprocess.run([path, "--help"], capture_output=True, timeout=2) return path except FileNotFoundError: continue- Confidence
- 79% confidence
- Finding
- The fallback entry 'traceroute' relies on PATH resolution, so if an attacker can influence PATH or place a malicious executable earlier in search order, this code may execute the wrong binary. In an agent/runtime environment where skills run with inherited environment variables, that can become arbitrary code execution.
