fix(themes): fix potential command injection in pygmalion, pygmalion-virtualenv and refined

The pygmalion and pygmalion-virtualenv themes unsafely handle git prompt information
which results in a double evaluation of this information, so a malicious git repository
could trigger a command injection if the user cloned and entered the repository.

A similar method could be used in the refined theme. All themes have been patched against this
vulnerability.
This commit is contained in:
Marc Cornellà 2021-11-09 09:54:21 +01:00
commit b3ba9978cc
No known key found for this signature in database
GPG key ID: 0314585E776A9C1B
3 changed files with 10 additions and 8 deletions

View file

@ -70,6 +70,7 @@ preexec() {
# Output additional information about paths, repos and exec time
#
precmd() {
setopt localoptions nopromptsubst
vcs_info # Get version control info before we start outputting stuff
print -P "\n$(repo_information) %F{yellow}$(cmd_exec_time)%f"
unset cmd_timestamp #Reset cmd exec time.