Development record
The guard allows rm -rf ${X:-$'/'}, ${X:-$"/"} and ${X:-$'\x2f'}, which bash 3.2, /bin/sh and bash 5.3 all print as / with X unset: spellWord reads a $ that opens no name as a word it cannot read and returns nil, so a default or alternative word written as an ANSI-C or a locale string is never read (review-guardSet MAJOR-1). The same reading misses ${X:-$!/}, which is / with no background job.
issueresolvedmajoriss-2609300057304812
The guard allows rm -rf ${X:-$'/'}, ${X:-$"/"} and ${X:-$'\x2f'}, which bash 3.2, /bin/sh and bash 5.3 all print as / with X unset: spellWord reads a $ that opens no name as a word it cannot read and returns nil, so a default or alternative word written as an ANSI-C or a locale string is never read (review-guardSet MAJOR-1). The same reading misses ${X:-$!/}, which is / with no background job.
Grounds
- pursued: rm -rf ${X:-$'/'}, ${X:-$"/"} and ${X:-$'\x2f'} block bare and as payloads; a default word spelled with another quoting or escape that decodes to / and still allows would show it wrong
Frontmatter
| id | iss-2609300057304812 |
|---|---|
| type | issue |
| lifecycle | resolved |
| severity | major |
.abcd/work/issues/resolved/iss-2609300057304812-the-guard-allows-rm-rf-x-x-and-x-x2f.md
open on GitHub ↗ · commit history ↗