Skip to content

[codex] Block unsafe git global options from safe allowlist#15796

Open
adrian-openai wants to merge 1 commit intomainfrom
dev/adrian/codex/bugb-15553-git-global-option-safety
Open

[codex] Block unsafe git global options from safe allowlist#15796
adrian-openai wants to merge 1 commit intomainfrom
dev/adrian/codex/bugb-15553-git-global-option-safety

Conversation

@adrian-openai
Copy link

@adrian-openai adrian-openai commented Mar 25, 2026

Summary

  • block git global options that can redirect config, repository, or helper lookup from being auto-approved as safe
  • share the unsafe global-option predicate across the Unix and Windows git safety checks
  • add regression coverage for inline and split forms, including bash -lc and PowerShell wrappers

Root cause

The Unix safe-command gate only rejected -c and --config-env, even though the shared git parser already knew how to skip additional pre-subcommand globals such as --git-dir, --work-tree, --exec-path, --namespace, and --super-prefix. That let those arguments slip through safe-command classification on otherwise read-only git invocations and bypass approval. The Windows-specific safe-command path had the same trust-boundary gap for git global options.

@adrian-openai adrian-openai marked this pull request as ready for review March 25, 2026 21:16
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