Command injection in ping handler
An AI assistant generated this Go HTTP handler for an internal ops tool that pings a host the user supplies, to check reachability. It works when you test it with `8.8.8.8`. Review it before it goes on the internal network.
Implement
build_ping_argv(host: str) → list[str]Examples
in
["8.8.8.8"]out["ping","-c","1","8.8.8.8"]in
["8.8.8.8; cat /etc/passwd"]out[]in
["internal-db.corp.example.com"]out["ping","-c","1","internal-db.corp.example.com"]What a strong answer looks like
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
0:00 of about 19 min
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.