Development record
The shell guard allows a recursive delete of the trailing-slash glob of the parent or of $PWD: `rm -rf ../*/`, `rm -rf $PWD/*/` and `rm -rf ${PWD}/*/` (and so `rm -rf ../../*/`) are an allow, while `rm -rf */` and `rm -rf ./*/` warn on rm-rf-working-directory. `../*/` globs every directory of the parent, the working directory among them, and `$PWD/*/` every directory of the working directory, as `./*/` does; the entry's arg_values name the trailing-slash glob for `*` and `./*` only. Confirmed at d94472abb while fixing iss-2610021542183618 (the parent-chain reading reaches `../*/` and finds no value for it).
The shell guard allows a recursive delete of the trailing-slash glob of the parent or of $PWD: rm -rf ../*/, rm -rf $PWD/*/ and rm -rf ${PWD}/*/ (and so rm -rf ../../*/) are an allow, while rm -rf */ and rm -rf ./*/ warn on rm-rf-working-directory. ../*/ globs every directory of the parent, the working directory among them, and $PWD/*/ every directory of the working directory, as ./*/ does; the entry's arg_values name the trailing-slash glob for * and ./* only. Confirmed at d94472abb while fixing iss-2610021542183618 (the parent-chain reading reaches ../*/ and finds no value for it).
Grounds
- pursued: the trailing-slash glob of every directory the entry names warns; one that still allows, or a corpus line that moves toward allow, would show it wrong
Frontmatter
| id | iss-2610021547096336 |
|---|---|
| type | issue |
| lifecycle | resolved |
| severity | minor |
.abcd/work/issues/resolved/iss-2610021547096336-guard-allows-the-trailing-slash-glob-of.md
open on GitHub ↗ · commit history ↗
mentions1
- iss-2610021542183618The shell guard allows a recursive delete of a chain of parents: `rm -rf ../..`, `rm -rf ../../.`, `rm -rf ../../..` and `rm -rf ../../*` are an allow, while `rm -rf ..`, `rm -rf ../.` and `rm -rf ../*` warn on rm-rf-working-directory. The entry's arg_values name `.`, `..`, `../` and `../*` but no deeper chain, and foldParents reads `../../.` as `../..`, which no value names, so TestTrailingDotAfterAParentFolds pins only that the two spellings agree. A chain climbs above the working directory's parent and holds it, so it deletes at least what `..` deletes. Found by the post-tag security review of 7fb52a6b5..d94472abb (sec-postTagA, LOW); present at both ends of that range.