Skip to content

damage-control: hidden input behind same-line openers and wrapper -c (#1144) - #1146

Merged
dotdevdotdev merged 2 commits into
mainfrom
dc-here-string
Oct 19, 2026
Merged

dotdevdotdev merged 2 commits into
mainfrom
dc-here-string

Conversation

@dotdevdotdev

Copy link
Copy Markdown
Owner

Two wrongful ALLOWs from the #1138 review, both fixed:

  1. A here-string behind a same-line compound keyword (if true; then sh <<< X; fi, also for/while/until, true; then): the feed line was not cut at its last segment break, so the keyword became the head word. Now cut before opener stripping.
  2. sudo|env|nohup|timeout N bash -c 'sh <<< X' (also heredoc): the -c payload scan only looked at a bare shell head; it now steps past prefix wrappers via _wrapped_command_index.

Tests: test_damage_control_hidden_input_positions.py, a differential matrix (here-string / heredoc / < <(...)) x 13 openers/wrappers == top-level decision. Mutation-checked: reverting the fix turns both tests red.
Audit-log replay (1685 distinct <</<( commands): 0 decision diffs. Full fast suite: 5951 passed. Rule baselines --check clean. Wiki residual moved out.

Not done: inventory item 19 (heredoc into xargs -I{} sh -c '{}') already blocks on main and is pinned in the existing carriers; item 14 table edits (parallel/flock/docker-run, bare eval asks) skipped.

Closes #1144

Built by dotdev.dev

…and wrapper -c is judged (#1144)

Cut the feed line at its last segment break before stripping openers, and let the
-c payload scan step past prefix wrappers. Differential matrix test: every
hidden-input form x opener/wrapper == top-level decision.

Built by dotdev.dev
@dotdevdotdev
dotdevdotdev marked this pull request as ready for review October 19, 2026 11:50
@dotdevdotdev
dotdevdotdev merged commit e3d63e1 into main Oct 19, 2026
5 checks passed
@dotdevdotdev
dotdevdotdev deleted the dc-here-string branch October 19, 2026 11:50
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.

damage-control: here-string payload hidden behind a same-line compound keyword or a wrapper -c is allowed

1 participant