#3632 · pretool/bash/network-egress-guard

A quoted heredoc is payload, not an operator

The guard asked "Downloads a script from the network and then executes it" on a command that downloads nothing. The script was authored inline by a quoted heredoc, and the curl inside it uploads a local file and writes the response to a data file that is only measured with wc -c. No remote byte ever reaches an interpreter.

normalizeSingle()   replaces every \n with a space
STAGED_RUN_RE       is written with [^\n]*? spans that assume \n survives
                    once flattened, those spans run the WHOLE command
egressDenyScanView  knows " and ' ... has no heredoc case

result: a curl -o on body line 6 pairs with `bash file` on line 12

Run the scan yourself

Each button feeds one command through the same two-step view the hook builds. Watch which ones survive to STAGED_RUN_RE.


      

after blankQuotedHeredocBodies + flatten:


      

The fix is the precedent dangerous-command-blocker already applies at its pipe-to-shell check (#3098). An UNQUOTED heredoc is shell-expanded, so it is deliberately left alone: this narrows the guard, it does not weaken it.