Remove shell expansion for git commands#447
Merged
Merged
Conversation
dkundel-openai
approved these changes
Jul 8, 2026
HerbertGao
added a commit
to HerbertGao/codex-plugin-cc
that referenced
this pull request
Jul 8, 2026
- v1.0.6 (PR openai#447): git commands no longer pass through a shell (shell: false) - Resolved version conflicts to 1.0.6-herbertgao.1 (fork suffix convention) - Preserved fork's codex-rescue foreground-forcing customization (untouched by v1.0.6) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
DKalien
added a commit
to DKalien/codex-plugin-cc
that referenced
this pull request
Jul 8, 2026
- Merge upstream security fix: remove shell expansion for git commands (openai#447) - Add options.shell override support in runCommand - Update version to 1.0.6.1 - Keep local Node.js v25 compatibility improvements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ensure Git commands are executed directly on Windows instead of being routed through a shell.
Git reference names can contain characters that Windows shells interpret specially. Passing those references through
shell: truecan therefore change the meaning of an otherwise valid Git command. This change keeps Git arguments as a literal argv array by forcingshell: falsein the shared Git helpers.Historical context
Windows npm installations expose tools such as
npmandcodexthrough.cmdshims, which Node cannot launch directly in some configurations.shell: truefor the shared synchronous command runner so Windows could resolve those shims.SHELL, preserving compatibility with Git Bash.Those changes fixed important Windows behavior, but the shared command runner also handles Git. Unlike
npmandcodex, Git is directly executable on Windows and does not need shell-based.cmdresolution.Changes
runCommandto override its shell setting.shell: falsein both Git command helpers.The regression test verifies that the branch name is passed to Git literally and that an adjacent command helper is not executed.
Compatibility
The existing Windows behavior remains unchanged for commands that require it:
.cmddiscovery continues to use the configured Windows shell.SHELLfor Git Bash users.This approach avoids restricting valid Git reference names and confines the change to the command path that does not require shell expansion.
Validation
npm test: 91 tests passedgit diff --check: clean