Skip to content

Harden spawn allowlist path matching - #121

Merged
pquerna merged 1 commit into
mainfrom
paul.querna/harden-spawn-allowlist-policy
Jun 29, 2026
Merged

Harden spawn allowlist path matching#121
pquerna merged 1 commit into
mainfrom
paul.querna/harden-spawn-allowlist-policy

Conversation

@c1-squire-dev

@c1-squire-dev c1-squire-dev Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • require --allowed-binaries entries to be absolute executable paths and canonicalize them at daemon startup
  • deny basename/relative spawn invocations whenever an allowlist is configured, closing the request-controlled PATH bypass
  • canonicalize absolute argv[0] before spawning so the path that passed policy is the path executed
  • update CLI/help docs and add daemon regression coverage for a fake sh in request-controlled cwd/PATH

Tests

  • cargo test -p agent-tui-daemon
  • cargo test -p agent-tui-daemon allowed_binaries_rejects_basename_with_request_controlled_path -- --nocapture
  • cargo test -p agent-tui lazy_spawn_forwards_allowed_binaries_to_daemon -- --nocapture
  • cargo fmt --check
  • cargo clippy -p agent-tui-daemon -p agent-tui --all-targets -- -D warnings

Require allowed binaries to be absolute canonical paths and deny basename invocations when an allowlist is configured. Canonicalize absolute argv[0] before spawning so the audited path is the executed path.

Add daemon coverage for a request-controlled PATH bypass attempt.

Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
@pquerna
pquerna merged commit 3ee7271 into main Jun 29, 2026
17 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.

1 participant