Development record
The shell guard reads a fixed-output $(cat <<'EOF' ... EOF) as its document's text, but not the same substitution spelled with backticks. A backtick cat of a literal here-document inside sh -c, bash -c or eval double quotes stays an uninspectable payload and warns, and a warn runs; the same backtick substitution standing alone in command position is a silent allow, while bash 3.2 and 5.3 run the document's command in all three shapes (verified with a neutral word). literalHeredocOutput is called only where the substitution opened with a dollar sign (tokenize.go), so the backtick spelling of the review5-guard finding 3 and review6-guard finding 1 shapes is still open.
The shell guard reads a fixed-output $(cat <<'EOF' ... EOF) as its document's text, but not the same substitution spelled with backticks. A backtick cat of a literal here-document inside sh -c, bash -c or eval double quotes stays an uninspectable payload and warns, and a warn runs; the same backtick substitution standing alone in command position is a silent allow, while bash 3.2 and 5.3 run the document's command in all three shapes (verified with a neutral word). literalHeredocOutput is called only where the substitution opened with a dollar sign (tokenize.go), so the backtick spelling of the review5-guard finding 3 and review6-guard finding 1 shapes is still open.
Grounds
- pursued: TestBacktickHereDocumentPayloadIsRead holds the sh -c, eval, nested-document and command-position shapes; it would be shown wrong by a backtick shape without a backslash that bash runs to a hazard and the guard lets through
Frontmatter
| id | iss-2609252310310823 |
|---|---|
| type | issue |
| lifecycle | resolved |
| severity | major |
.abcd/work/issues/resolved/iss-2609252310310823-the-shell-guard-reads-a-fixed-output-cat.md
open on GitHub ↗ · commit history ↗