Skip to content

fix: keep CLI provider prompts out of process arguments - #10547

Merged
alexhancock merged 2 commits into
mainfrom
jbg/security-cli-prompt-stdin
Jul 27, 2026
Merged

fix: keep CLI provider prompts out of process arguments#10547
alexhancock merged 2 commits into
mainfrom
jbg/security-cli-prompt-stdin

Conversation

@jbg

@jbg jbg commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • pipe Cursor Agent and Gemini CLI prompts through child stdin instead of process arguments
  • close stdin after writing while preserving model, session, output, force, and yolo flags
  • keep prompt writes, stdout reads, and stderr drains concurrent, with child cancellation on drop
  • add recording-shim coverage for initial and resumed/multi-turn requests from both providers

Security impact

Serialized system, conversation, and user prompt content is no longer exposed through child process argv to same-host process inspection.

Fixes project-loupe/audit-goose#66.
Fixes project-loupe/audit-goose#251.

Validation

  • cargo fmt --all
  • cargo test -p goose is_sent_on_stdin -- --nocapture (4 passed)
  • cargo test -p goose providers::cursor_agent::tests:: -- --nocapture (2 passed)
  • cargo test -p goose providers::gemini_cli::tests:: -- --nocapture (3 passed)
  • cargo build -p goose
  • cargo clippy -p goose --all-targets -- -D warnings

This finding was discovered by Project Loupe.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fc79305e4e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/goose/src/providers/cursor_agent.rs Outdated
@jbg

jbg commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fc79305e4e

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/goose/src/providers/cursor_agent.rs Outdated
@jbg
jbg requested review from DOsinga and michaelneale July 17, 2026 22:23
@alexhancock
alexhancock merged commit 971d217 into main Jul 27, 2026
26 checks passed
@alexhancock
alexhancock deleted the jbg/security-cli-prompt-stdin branch July 27, 2026 19:36
lifeizhou-ap added a commit that referenced this pull request Jul 28, 2026
* main: (28 commits)
  chore(deps): bump postcss from 8.5.10 to 8.5.23 in /documentation (#10721)
  chore(deps-dev): bump js-yaml from 4.2.0 to 4.3.0 in /documentation (#10735)
  chore(deps): bump fast-uri from 3.1.2 to 3.1.4 in /documentation (#10647)
  chore(deps): bump svgo from 3.3.3 to 3.3.4 in /documentation (#10646)
  chore(deps): bump docker/login-action from 4.4.0 to 4.5.1 (#10670)
  chore(deps): bump ossf/scorecard-action from 2.4.3 to 2.4.4 (#10671)
  chore(deps): bump pypa/gh-action-pypi-publish from 1.14.0 to 1.14.1 (#10674)
  fix(providers): update DeepSeek model names to v4 API (#10729)
  fix(acp): forward Claude Code model picker selection to the adapter (#10675)
  fix(acp): forward Pi model selection to the adapter (#10707)
  fix(config): preserve enabled flag when migrating platform extensions (#10690)
  fix(acp): pass session working_dir to on_call_tool (#10689)
  fix(security): preserve adversary tool arguments (#10529)
  fix(local-inference): keep XML snippets inside JSON as data (#10606)
  fix: sync generated chat title in header (#10578)
  feat: tab completion and switch provider for `model` (#10585)
  fix(telegram): prompt for tool approval in gateway sessions (#10613)
  fix: keep CLI provider prompts out of process arguments (#10547)
  fix(providers): ignore stale inventory for static model lists (#10591)
  fix(ui): Refine dark theme message surfaces for consistent, compliant dark mode UX. (#10693)
  ...
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.

3 participants