An argv list fixed the injection. A deadline fixed the hang.
For months the advice I gave was the same: stop building shell strings, pass a list. If a value came from a user, it stayed data. subprocess.run(["echo", text]) and the parentheses, backticks and $(...) inside text never reach a shell, because there is no shell to reach.
That part works. I shipped a small library, shellguard, that refuses shell=True and bare-string commands so nobody on my team can drift back into the old habit. It is 144 tests deep now, and the attack suite covers the usual metacharacters.
But a clean injection story still leaves one failure on the table.
A command can be perfectly safe and still never come back.
I had a wrapper around a CLI that occasionally blocked waiting on input nobody was going to give it. The argv list was fine. No shell involved. The process just sat there, holding a worker slot, until something upstream gave up and killed the whole job. At the time I treated it as an infrastructure problem.β¦