Skip to content

fix(#950): catch command/nice/stdbuf and backslash .. escapes in the Bash grant allowlist - #986

Merged
fdaviddpt merged 2 commits into
mainfrom
fix/950
Oct 8, 2026
Merged

fdaviddpt merged 2 commits into
mainfrom
fix/950

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

Closes #950.

check_release_tree.py's bash_grant_problem (the check behind a release-gate Bash-grant audit) missed four unsafe shapes: the command builtin, nice, stdbuf, and a backslash-separated .. path escape -- all four returned None (not flagged) before this fix.

What changed

Tests

Reproduced all cases directly against the module before editing (red: all returned None). After the fix: pytest tests/test_release_branch_preflight_851.py -q -> 220 passed, 1 skipped (pre-existing, unrelated skip). No full-suite run locally; CI is this repo full-suite gate.

Closes #950.

[AI-generated]

fdaviddpt and others added 2 commits October 8, 2026 05:59
…Bash grant allowlist

`_UNSCOPED_COMMANDS` in check_release_tree.py now lists `command`, `nice`
and `stdbuf` alongside the existing wrapper commands (#879), and the `..`
path-escape check splits on both forward and backslash separators instead
of forward slash only. docs/releasing.md's wrapper-command coverage note
is corrected to match current coverage rather than claiming it is "not
yet" handled.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…oblem

Review (oss:auditor) caught that `paths = [w for w in words if "/" in w]`
still only collected a word as "a path" when it contained a forward
slash, so a grant whose path was entirely backslash-separated (e.g.
`${CLAUDE_PLUGIN_ROOT}\..\..\bin\bash`) skipped the whole per-path loop --
including the just-widened `..` check -- and fell through to `None`.
Widen the membership test to `"/" in w or "\\" in w`, and add the missing
test case.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@fdaviddpt
fdaviddpt merged commit 9d75dd8 into main Oct 8, 2026
19 checks passed
@fdaviddpt
fdaviddpt deleted the fix/950 branch October 8, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check_release_tree.py wrapper-command allowlist misses command, nice, stdbuf, and a backslash .. escape

1 participant