jay 7abb973f72
fix(harness): detect shell pipe variants with sudo, full paths and other shells (#6312)
* fix(harness): detect shell pipe variants with sudo, full paths and other shells

The shell-curl-pipe-shell rule only matched the bare 'curl ... | bash'
spelling. The variants that real install scripts actually ship —
'sudo bash', 'sudo -E bash', '/bin/bash', 'zsh'/'dash'/'fish', and
line-continued pipes — produced no finding at all, so a HIGH-severity
remote-code-execution pattern went unreported (#6310 lists the table).

The pattern now tolerates an optional sudo/doas-style flag prefix, full
interpreter paths, and line continuations, and covers the common shell
names. Non-shell pipes (jq, tee) stay unreported.

Fixes #6310

* test(skillscan): restore lost parametrize decorator in merge resolution

* test(skillscan): fix indentation of the http_host parametrize block

* style: ruff-format the skillscan test file

* fix(skillscan): bound pipe matching and handle real continuations

* fix(skillscan): tolerate continuations between sudo, its flags and the shell

Verified undetected until now: `curl ... | sudo \
  bash` and the -E
variant (LF and CRLF). Whitespace runs inside the sudo segment use the same
disjoint (?:\s|\\r?\n)+ shape as the pipe side; value-bearing flags such as
sudo -u root stay intentionally out of scope and are documented in the skills
AGENTS.md note. 17 positive / 6 negative variants verified red-to-green.
2026-10-05 19:53:01 +08:00
..