Re: [SECURITY PATCH] git-prompt.sh: don't put unsanitized branch names in $PS1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Richard Hansen <rhansen@xxxxxxx> writes:
>
>> Both bash and zsh subject the value of PS1 to parameter expansion,
>> command substitution, and arithmetic expansion.  Rather than include
>> the raw, unescaped branch name in PS1 when running in two- or
>> three-argument mode, construct PS1 to reference a variable that holds
>> the branch name.  Because the shells do not recursively expand, this
>> avoids arbitrary code execution by specially-crafted branch names such
>> as '$(IFS=_;cmd=sudo_rm_-rf_/;$cmd)'.
>>
>> Signed-off-by: Richard Hansen <rhansen@xxxxxxx>
>
> I'd like to see this patch eyeballed by those who have been involved
> in the script (shortlog and blame tells me they are SZEDER and
> Simon, CC'ed), so that we can hopefully merge it by the time -rc1 is
> tagged.
>
> Will queue so that I won't lose it in the meantime.
>
> Thanks.

Sadly, this does not seem to pass t9903.41 for me.

    $ bash t9903-*.sh -i -v

ends with this: 

    --- expected    2014-04-21 22:31:46.000000000 +0000
    +++ .../t/trash directory.t9903-bash-prompt/actual  ...
    @@ -1 +1 @@
    -BEFORE: (master):AFTER
    \ No newline at end of file
    +BEFORE: (${__git_ps1_branch_name}):AFTER
    \ No newline at end of file
    not ok 41 - prompt - pc mode
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]