Dang. Unfortunately I am not vulnerable, and I use default ohmyzsh. This is a neat bug, though. Lots of package managers have similar problems, and I would not be surprised if there's a lot of git/shell/environment problems left to find.
Why is it unfortunate that you're not vulnerable? Isn't that a good thing?
A proof-of-concept of a vulnerability in custom shell prompt scripts
31–40 of 54 posts
Re: A proof-of-concept of a vulnerability in custom shell prompt scripts
#32The "official" git prompt[1] is safe on Bash; the script doesn't run. [1]: https://github.com/git/git/blob/master/contrib/completion/gi...
In particular see the long comment at line 324.
[1]: https://github.com/git/git/blob/9d77b0405ce6b471cb5ce3a90436...
Re: A proof-of-concept of a vulnerability in custom shell prompt scripts
#33 git co -b foo to complete branch names
git co -b foo $(./pw3n) Re: A proof-of-concept of a vulnerability in custom shell prompt scripts
#34Dang. Unfortunately I am not vulnerable, and I use default ohmyzsh. This is a neat bug, though. Lots of package managers have similar problems, and I would not be surprised if there's a lot of git/shell/environment problems left to find.
Oh god why. Use https://github.com/sorin-ionescu/prezto
Re: A proof-of-concept of a vulnerability in custom shell prompt scripts
#35ohmyzsh is vulnerable.
Re: A proof-of-concept of a vulnerability in custom shell prompt scripts
#36The "official" git prompt[1] is safe on Bash; the script doesn't run. [1]: https://github.com/git/git/blob/master/contrib/completion/gi...
Nothing gets past Linus
Re: A proof-of-concept of a vulnerability in custom shell prompt scripts
#37The "official" git prompt[1] is safe on Bash; the script doesn't run. [1]: https://github.com/git/git/blob/master/contrib/completion/gi...
https://github.com/git/git/commit/8976500cbbb13270398d3b3e07...
Re: A proof-of-concept of a vulnerability in custom shell prompt scripts
#38Tab autocompletion looks to be affected too, at least on my system. Create a branch called 'complete_$(./foo)'. Then type 'git checkout comp '. This gets autocompleted to git checkout complete_$(./foo) If you hit Enter at this point without thinking you'll end up running './foo'. It should have expanded instead to something like git checkout 'complete_$(./foo)' or git checkout complete_\$\(./foo\)
Re: A proof-of-concept of a vulnerability in custom shell prompt scripts
#39ohmyzsh is vulnerable.
Re: A proof-of-concept of a vulnerability in custom shell prompt scripts
#40Still not as worrisome to me as the full scripts that get executed by package managers when you install dependencies. Effectively every time you run something like "npm install" you're putting your faith in the entire tree of ancestor dependencies as any of them could have a pwnage script as a post install.