Skip to content

[WRONG BRANCH] fix(qoder): keep system/developer prompts out of child-process argv by using prompt file - #478

Draft
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-qoder-vulnerability
Draft

[WRONG BRANCH] fix(qoder): keep system/developer prompts out of child-process argv by using prompt file#478
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-qoder-vulnerability

Conversation

@luvs01

@luvs01 luvs01 commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Motivation

  • The Qoder adapter placed concatenated system and developer prompts directly into the child-process argv, which exposes confidential prompt content to other local users via process inspection on common OSes.

Description

  • Change buildQoderArgs() to accept an optional systemPromptFile and use --append-system-prompt-file instead of embedding the prompt text into argv.
  • In createQoderAdapter().runTurn, write the folded system+developer prompt to a private temporary file created with mkdtemp, written with mode 0600, and pass the file path to buildQoderArgs() so the CLI reads the prompt from the file.
  • Fail closed and emit a structured error if prompt-file preparation fails, and always attempt to remove the temporary directory after the turn (rm(..., { recursive: true, force: true }).catch(() => {})).
  • Add a focused regression test in tests/providers/qoder-adapter.test.ts that asserts prompt text is not present in argv, that the CLI receives the prompt via the file, and that the temporary file is deleted after the turn.

Testing

  • Ran the focused adapter tests with bun test tests/providers/qoder-adapter.test.ts, which passed (6 tests, 0 failures).
  • Ran bun run typecheck which succeeded.
  • Ran bun run privacy:scan which succeeded.
  • Ran the repository-wide bun run test and observed unrelated environment-sensitive failures in the full suite (worker panic and a few Codex shim process-group tests); the focused Qoder change passed in isolation.

Codex Task

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T02:48:37.267020Z 04c2097 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.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: aeb67628-c5b8-47f5-8d6e-7eae1f33b5c0


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 10, 2026

@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: 04c209734b

ℹ️ 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 on lines +64 to +66
promptDir = system ? await mkdtemp(join(tmpdir(), "ocx-qoder-prompt-")) : undefined;
promptFile = promptDir ? join(promptDir, "system-prompt.txt") : undefined;
if (promptFile) await writeFile(promptFile, system!, { encoding: "utf8", mode: 0o600 });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Harden the prompt file ACL on Windows

On Windows, mode: 0o600 does not remove inherited ACEs, as documented by the repository's existing src/lib/windows-secret-acl.ts:4-8. When %TEMP% is shared or inherits access for Users/Authenticated Users, another local account can enumerate or read this file, whose path is also exposed through --append-system-prompt-file, defeating the security purpose of this change. Harden the temporary directory before writing and/or the file before spawning with the existing required async Windows ACL helpers, and fail closed if hardening fails.

AGENTS.md reference: AGENTS.md:L357-L363

Useful? React with 👍 / 👎.

@github-actions github-actions Bot changed the title fix(qoder): keep system/developer prompts out of child-process argv by using prompt file [WRONG BRANCH] fix(qoder): keep system/developer prompts out of child-process argv by using prompt file Sep 10, 2026
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as draft September 10, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant