Skip to content

fix: harden terminal-shell shell validation - #39

Merged
rysweet merged 1 commit into
mainfrom
fix/issue-38-terminal-shell-shell-validation
Mar 29, 2026
Merged

fix: harden terminal-shell shell validation#39
rysweet merged 1 commit into
mainfrom
fix/issue-38-terminal-shell-shell-validation

Conversation

@rysweet

@rysweet rysweet commented Mar 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • harden terminal-shell so shell: only accepts an absolute executable path made of safe path characters
  • reject non-absolute and metacharacter-bearing shell values before they reach the script -c launch string
  • add an outside-in regression that proves malicious shell: input is rejected without creating the injected side-effect file

Why

PR #37 introduced terminal-shell, but the initial shell normalization logic still allowed command-substitution-style metacharacters such as $() to flow into the script -c launch command. That made command injection possible through the operator-facing objective.

Validation

  • cargo fmt --all
  • cargo test --all-features --locked
  • tests/gadugi/terminal-session.sh
  • tests/gadugi/smoke-explicit-local.sh
  • tests/gadugi/smoke-explicit-rusty-clawd.sh
  • tests/gadugi/smoke-builtin-defaults.sh
  • tests/gadugi/composite-identity.sh
  • tests/gadugi/meeting-mode.sh
  • tests/gadugi/handoff-roundtrip.sh
  • tests/gadugi/review-mode.sh
  • tests/gadugi/gym-suite.sh
  • python3 -m pre_commit run --all-files --hook-stage pre-commit
  • python3 -m pre_commit run --all-files --hook-stage pre-push

Closes #38.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rysweet
rysweet merged commit e0a783e into main Mar 29, 2026
3 checks passed
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.

Fix terminal-shell shell path injection

1 participant