mathiasbynens / mathiasbynens/dotfiles

git prompt branch name code injection possibility?

Open
#431 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
31.5k
Forks
8.4k
PR merge metrics
No merged PRs in 30d

Description

after reading your git prompt code and comparing it to the official git-prompt.sh i'm not sure your code doesn't suffer from an injection vulnerability with a specially crafted ref name.

if you think that's not the case just close this issue

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with .bash_prompt around line 50 and compare it with contrib/completion/git-prompt.sh around line 309. Check how specially crafted ref names are incorporated into the prompt and whether they can be interpreted by the shell. Done means either a demonstrated vulnerability with a scoped fix or a documented reason the behavior is safe.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, git, shell
Domain
cli, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.