Agent executes backticks in git commit message (command substitution)

Resolved 💬 1 comment Opened Feb 20, 2026 by samsonjs Closed Feb 25, 2026

Summary

When Codex runs git commit -m "..." and the commit message includes backticks, the shell performs command substitution and executes the backticked command instead of treating it as literal text.

Reproduction

  1. Ask Codex to create a commit with a message that contains backticks, for example: Add ci script that runs script/ci``.
  2. Codex runs a shell command like:

git commit -m "Add ci script that runs script/ci".

  1. The backticked command is executed by the shell.

Expected

Backticks in commit messages are treated as literal characters in the commit text.

Actual

Backticked content is executed by the shell, causing side effects and potentially dangerous behavior.

Impact

  • Unintended command execution
  • Confusing output during commit
  • Safety risk if message content is user-controlled

Suggested fix

  • Avoid interpolated shell strings for commit messages.
  • Use a safe argument form (no shell evaluation), or write message to a temp file and use git commit -F <file>.
  • If shell strings must be used, escape/sanitize backticks and other command-substitution syntax.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗