Skip to content

fix: allow # character in branch name validation - #956

Open
ovp87 wants to merge 1 commit into
anthropics:mainfrom
ovp87:fix/allow-hash-in-branch-names
Open

ovp87 wants to merge 1 commit into
anthropics:mainfrom
ovp87:fix/allow-hash-in-branch-names

Conversation

@ovp87

@ovp87 ovp87 commented Feb 17, 2026 •

Copy link
Copy Markdown

Summary

  • Adds # to the branch name validation whitelist regex in validateBranchName()
  • The # character is valid per git-check-ref-format and commonly used in branch naming conventions like bugfix/#123-description
  • Since PR Fix command injection vulnerability in branch setupΒ #736 switched git commands to execFileSync (no shell interpolation), # poses no injection risk β€” it's only meaningful in shell contexts (as a comment character)
  • Adds test cases for branch names containing #

Fixes #751

The # character is valid per git-check-ref-format and commonly used in
branch naming conventions like "bugfix/anthropics#123-description". Since git
commands are now executed via execFileSync (no shell interpolation),
the # character poses no injection risk.

Fixes anthropics#751

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ovp87

ovp87 commented Mar 27, 2026

Copy link
Copy Markdown
Author

@ddworken any chance we can get a review on this?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant