On Mon, Sep 29, 2014 at 2:48 PM, Gauthier Van Vreckem
<
gvanv...@gmail.com> wrote:
>
>> On Monday, September 29, 2014 11:41:58 AM UTC+2, Erik Faye-Lund wrote:
>>> From:
>>>
>>>
http://unix.stackexchange.com/questions/157477/how-can-shellshock-be-exploited-over-ssh
>>>
>>> It seems that it may only be vulnerable if using keys for user
>>> authentication and only authenticated users would be able to use one
>>> exploit
>>> to bypass restrictions which I'm not sure are even in place.
>>> So the questions are:
>>> Using any of the default setup available is there a remotely exploitable
>>> vulnerability?
>>> What kind of sshd config is the ssh-agent.exe using, is it using
>>> ForceCommand or command=
>>
>> If I understand the situation correctly, you need some way of remotely
>> calling bash (with user-controlled input, through an unauthenticated
>> user), for this to really be a vulnerability.
>
> Not at all, that vulnerability exploit apply only to untrusted authenticated
> users
> trough ssh keys.
>
How is that not exactly what I said?
> But if there is any way to remotely trigger the creation of an user
> controlled
> environment variable prior to executing bash which is used to launch git we
> are dead too.
>
Yes, but we don't provide any means of doing this. But thanks for
pointing it out.
>> Git for Windows does not, to my knowledge, provide a mechanism to
>> remotely call bash with user-input (we can call hooks, but to install
>> a malicious hook you already need access to the machine).
>
> There is no need for the hooks to be malicious, just to exist.
> All that is needed is a way to set user controlled environment variables.
> The .cmd wrapper with a SET command are prime candidate.
> ( Exactly as it is done in start-ssh-agent.cmd ! )
> and in that regard, the codebase is rather lazy and seems to resort
> to environement variables even when not needed.
> In fact un-setting all the temporary variables left over to reconstruct a
> command line would probably
> remove any bash risks.
But you cannot remotely inject environment variables, so the whole
point is moot. If you can inject environment variables, you can do a
lot of other nasty things as well; you're already inside the air-tight
hatch.