Skip to content

Harden nested Bash permission matching - #350

Merged
yottadynamics merged 1 commit into
mainfrom
worktree-bash-permissions-hardening
Sep 19, 2026
Merged

yottadynamics merged 1 commit into
mainfrom
worktree-bash-permissions-hardening

Conversation

@yottadynamics

Copy link
Copy Markdown
Owner

Summary

Hardens Bash permission matching for compound and nested commands.

Bash commands are already split across shell separators, but nested command substitutions and backticks were treated as part of the outer descriptor. This allowed an outer allow rule such as Bash(echo *) to cover an unreviewed nested command. The evaluator now extracts nested commands as additional permission targets, preserving deny/ask/all-allow semantics across the full command tree.

This PR deliberately does not claim that command-text matching is an OS security boundary. The documentation directs users to the command sandbox for enforcement against alternate executable paths, scripts, aliases, and indirect subprocess access.

Related issue

Not linked.

How was this tested?

  • go test ./...
  • go vet ./...
  • git diff --check

All passed.

Checklist

  • go test ./... passes
  • go vet ./... is clean
  • govulncheck ./... reports no reachable vulnerabilities
  • Tests added or updated
  • Docs updated in the same change
  • PR is focused on one logical change

Drafted with yottacode


Drafted with yottacode

@yottadynamics
yottadynamics force-pushed the worktree-bash-permissions-hardening branch from e4277dd to 52f69fc Compare September 15, 2026 13:10
@yottadynamics

Copy link
Copy Markdown
Owner Author

Updated PR #350 with the follow-up security fixes:

  • process substitutions such as cat <(curl evil) are now extracted as nested permission targets;
  • malformed/unbalanced shell input falls back to approval instead of being auto-allowed;
  • added regression tests for process substitutions, quoted/nested substitutions, malformed shell, and nested deny behavior.

Verification passed:

go test ./...
go vet ./...
git diff --check

The branch was reconciled with the remote PR commit and force-updated using --force-with-lease after confirming the divergence was only the prior PR commit plus the local amended fix.

@yottadynamics
yottadynamics merged commit 646df88 into main Sep 19, 2026
13 of 14 checks passed
@yottadynamics
yottadynamics deleted the worktree-bash-permissions-hardening branch September 19, 2026 18:48
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.

1 participant