Repository navigation
damage-control: hidden commands are judged as commands (batch 3) - #1138
Merged
Merged
Conversation
sed e / s///e, awk system, tar/git/npm/ssh exec options, <(…), heredoc and
here-string into shells, xargs -I{} sh -c, sftp, embedded-language
interpreters, mosh, parallel/flock/docker launcher grammar.
Built by dotdev.dev
Built by dotdev.dev
Built by dotdev.dev
… verb rules (#1136) Built by dotdev.dev
Built by dotdev.dev
…llel and container/compose/kubectl exec carry commands (#1136) Built by dotdev.dev
Built by dotdev.dev
… stdin, cat <<< and printf producers, container global options, oc, sed _ delimiter (#1136) Built by dotdev.dev
…+-c+nested here-string residuals Built by dotdev.dev
Built by dotdev.dev
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.
Text another program RUNS is now judged as a command in its own right, so a payload's decision inside a carrier equals its decision alone.
What changed (
agentwire/safety/_core.py, no rule YAML, no baseline change)_hidden_commands: stdin programs,<(…)/>(…)bodies, and executed option values/embedded programs (sede/s///e, awksystem/getline/pipe, tar--to-command/--checkpoint-action/-I, gitdifftool -x/--upload-pack/--receive-pack/grep -O/filter-branch/submodule foreach/bisect run/set-formconfig <exec-key>,npm exec -c, ssh/scp/sftp-o ProxyCommand)._decide_commandrecurses over them (strictest verdict wins, outer escape/kill switch ends the walk);_derived_commandsfeeds the same list to the protected-path scan.xargs -I{} sh -c '{}'; sftp beside scp (+ stdinget/!); lua/luajit/tclsh/wish/R/Rscript/julia/groovy/osascript/expect in the interpreter net (stdin-as-program only when bare);moshas ssh; remote interpreter stdin re-scanned as that interpreter's inline program.parallel … :::,flock LOCK cmd,docker|podman run|exec IMAGE cmdhave grammars, so the verb is the command (the eval word only; docker run still asks by its own rule).Verification
tests/unit/test_damage_control_hidden_commands.py: differential over 4 payloads × ~47 carriers, benign-payload and plain-form controls, remote-interpreter, sftp, interpreter net, escape/kill-switch, bounded nesting, launcher grammar. Mutation-checked: disabling the recursion, procsub, tar/sed/git extractors, inline-program wrap, sftp batch, or tool detection each turns it red.parallel … grep eval/flock … grep evalnow allow;| lua -eis no longer the "non-interpreter" control (now| jq .).-m "not requires_tmux and not slow"): 5901 passed pre-merge; damage/safety subset 1487 passed after merging main. Hooks regenerated;gen_rule_baselines --checkclean.hooks installafter merge).Declared residuals: a here-string after a compound keyword on the SAME line (
if true; then sh <<< 'rm -rf xx'; fi,for…do bash <<<…; done); wrapper +-c+ nested here-string (sudo|env|nohup|timeout N bash -c 'sh <<< "rm -rf xx"'); local interpreter stdin (see wiki).Closes #1136
Built by dotdev.dev