Skip to content

Keep room text and GitHub tokens out of the shell - #147

Open
ThinkOffApp wants to merge 7 commits into
mainfrom
fix/aikido-exec-no-shell
Open

ThinkOffApp wants to merge 7 commits into
mainfrom
fix/aikido-exec-no-shell

Conversation

@ThinkOffApp

Copy link
Copy Markdown
Owner

Room-sourced strings no longer reach a shell in automation, nudges, or pollers. The GitHub token is passed in an Authorization header instead of on a command line. The comment poller delivers each comment once.

This is a large change because the same pattern was copied in many places (33 files, 7 commits on origin/main). A list of remaining execSync sites that do not take room text is in docs/remaining-execsync.md for a later, separate change.

Tests

From this tree: npm install && npm test (937/937). Independently reproduced with npm ci --ignore-scripts --no-audit --no-fund && npm test.

Live checkouts are not this branch. Merging this PR does not by itself update a running Mac copy.

Petrus Pennanen added 7 commits November 19, 2026 03:43
Run exec as argv via execFileSync. Do not expand ${body}. Reject shell
metacharacters. Live Mac rules are still nudge-only; this closes the
code path Aikido flagged in room-automation.mjs.
Substituted ${room} and ${sender} must match the allowed token and must
not start with -. A failed value refuses the action instead of running
with a missing argument. Commands are split on spaces and run without a
shell; quotes, pipes and redirects in a rule no longer work, by design.
A rule that needs those should call a script file.
send-keys -l takes the text as one argument. Session names use the same
strict token as exec substitutions. The pause before Enter is a timer.
Tests feed a body with shell characters and check the argv log.
utils.mjs and ide/comment-poller.mjs use the shared tmux helper.
Comment pollers and the HTTP adapters GET with fetch; tokens go in
headers, not on a command line. Remaining execSync sites are listed
in the room.
Inventory only. Values and sources per site. Do not convert
these on this branch.
Interval ticks wait for the current poll so a slow fetch cannot
reload an independent seen set. send-keys gets -- before the text
so a leading dash is not an option. Request-construction errors
throw and log a fixed message, never the header value.
Worktrees need their own npm install before npm test.
Isolated socket, default server untouched. Capture-pane must show
the text that starts with a dash.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T05:43:04.249518Z e2d8c60 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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