Close the wrapper/compound bypass in the local decision engine (0.12.0) - #19
Merged
Conversation
bin/decide.mjs is the verbatim mirror of acp-install's decide.mjs, and carried the same p0 hole (acp-install#19/#18): wrapper positional operands (sudo -u root, timeout 5, nice -n 10) were classified as the binary, git -C . push --force origin main produced the malformed key Bash.git.. past both floor and policy, subshells/braces/fish -c were gaps, and a policy deny was evadable by prefixing a benign segment (true && gcloud ...). Sync the fixed engine (wrapper operand consumption, option-argument skipping in firstSubcommand, subshell/keyword handling, most-privileged compound classification, strictest-verdict per-segment policy checks, explicit Bash.unknown for unparseable commands), and add test/wrapper-bypass.test.mjs — the plugin-side regression guard this mirror never had. Bump 0.11.0 -> 0.12.0 across plugin.json, marketplace.json, and PLUGIN_VERSION together (the #18 lesson). Companion to acp-install's fix for acp-install#19.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
bin/decide.mjsis the verbatim mirror of acp-install'sdecide.mjsand carried the same p0 bypass class (acp-install#19 / acp-install#18): wrapper positional operands (sudo -u root …,timeout 5 …,nice -n 10 …) were classified as the binary,git -C . push --force origin mainproduced the malformed keyBash.git..past both the hardline floor and the shippedBash.git.pushrule, subshells / brace groups /fish -cwere gaps, and a user-set policy deny was evadable by prefixing any benign segment (true && gcloud …).The fix
Syncs the repaired engine from acp-install's companion PR (same bytes):
git -C /repo push→Bash.git.push).()are segment separators, so subshells and$( )are inspected; compound commands classify by their most-privileged segment and every segment is policy-checked with the strictest verdict winning (deny > ask > allow).Bash.unknown— governable, falls back toBash, honestly labeled — never a wrong-segment key.SHELL_BINSgains fish/csh/tcsh; rm danger targets gain/..Mirrors the gateway-side fix for this class (gsc#516 / gsc#750).
Tests
Adds
test/wrapper-bypass.test.mjs— the plugin-side regression guard this mirror never had (acp-install#19 noted the plugin copy was unguarded). Full corpus of the bypass shapes plus negative cases; all verification is string-in / verdict-out through the pure decision functions — no command from the corpus is ever executed.node --test: 97 pass / 0 fail.node scripts/validate-manifest.mjsgreen.Version
0.11.0 → 0.12.0 bumped together across
plugin.json,.claude-plugin/marketplace.json, andPLUGIN_VERSIONinbin/govern.mjs— the #18 lesson (a bump announced but never made in the manifests never reaches installed plugins).Refs acp-control-plane/acp-install#19.