mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3975] [Other] Manual mode: allowlisted "read-only" commands have write and execute modes that run without a card #1706
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1706
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Mqrius on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3975
Several pre-approved read-only commands can in fact execute arbitrary files or writes. In manual mode you don't get a request to confirm them, which seems like a failure of the harness.
I had Opus 5.5 enumerate all of them, though it might have missed something. For safety, the flags for a bunch of these should probably be block-by-default as well.
The rest of this report is written by Opus:
Version
Checked against v0.2.4 (
96ca4383),apps/host/server/agent/plugins/strata-gate.mjs.Summary
isReadOnlyShelllets a command run unasked if every pipeline segment starts with a word fromSAFE_COMMANDS, and the only per-word flag check is^-(delete|exec|execdir|fprint|fls|ok)$(line 126). Several allowlisted commands can write files or start other programs through options or arguments that this check doesn't cover. In Manual mode these run with no approval card.This is from reading the code plus each tool's documented options. I haven't run these through the app.
sortsort --compress-program=PROG(GNU sort runs PROG for its temp files)rgrg --pre PROG patternruns PROG for every file searchedgit grep(inSAFE_GIT)git grep -O<cmd>/--open-files-in-pager=<cmd>sortsort -o FILE,--output=FILEuniquniq IN OUT: the second operand is the output file, no flag neededtreetree -o FILEfilefile -C -m Xcompiles X into X.mgcdatedate -s/--set(needs admin rights)tailtail -fThe three "runs a program" cases matter most: they turn a look-only command into running an arbitrary program, and the program name doesn't need to be one of the words
UNSAFE_SYNTAXblocks (sh,bash,pwsh, ...).The flag check also only matches the exact short forms: attached or long forms like
--output=FILEand-oFILEdon't go through any check.Suggestion
Flip the per-command check from a deny-list of flags to an allow-list of flags per command, e.g.
sort: [-r -n -u -k -t -f -h -V ...],uniq: [-c -d -u -i]with at most one positional argument,rg: [-i -n -l -c -w -F -e -g --type ...], and so on. The allowlist is small (about 50 words), so the safe options for each command can be listed completely, and anything else asks. That also removes the need to remember every tool's exotic options when a word is added later.Thanks for the fail-closed design and
gate-fail-closed.test.mjs. This is a hole in the classifier's coverage, not its structure.Problem: See above
Environment:
96ca4383, windows 10, AMD Radeon RX 7900 XT 20GB VRAM, 64 RAMReproduce: See above
Expected: See above
Actual: See above
Evidence: See above
Reproduction status: See above
@github-actions[bot] commented on GitHub (Oct 24, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Oct 24, 2026):
Thanks, this follows the format now.
@Niko1221 commented on GitHub (Oct 27, 2026):
Thanks for the detailed list. Every case in the table now asks (sort -o and --compress-program, rg --pre, git grep -O, uniq IN OUT, tree -o, file -C, date -s, tail -f), and so do the spellings the old check missed (attached, clustered, abbreviated, quoted). The allowlist now works the way you suggested: each command has a list of options that only look, and any other option asks. Fixed in 0.2.7.
Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7