Live data from Hacker News

SSH ProxyCommand == unexpected code execution (CVE-2023-51385)

vin01.github.io

11–16 of 16 posts

Re: SSH ProxyCommand == unexpected code execution (CVE-2023-51385)

#11
post #4
post #2

From the OpenSSH update: “Although we believe it is the user's responsibility to ensure validity of arguments passed to ssh(1), especially across a security boundary such as the git example above, OpenSSH 9.6 now bans most shell metacharacters from user and hostnames supplied via the command-line. This countermeasure is not guaranteed to be effective in all situations, as it is infeasible for ssh(1) to universally fi…

> but honestly it's not far off that level of “well, duh” I think the real problem is that other apps do use ssh and malicious actors can inject untrusted input without the user's consent. The git POC is one example, and while I do think that git also needs to be updated, fixing the problem on the ssh side is also a good idea

OP here. Another interesting attack vector I have been working on is OSC 8 for hyperlink support in terminals. Mostly they allow arbitrary url schemes including "ssh://" without any prompt or user interaction to consent to open an external tool like ssh client in this case.

A good discussion on this: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3c...

Re: SSH ProxyCommand == unexpected code execution (CVE-2023-51385)

#12

Wow, this is a security vulnerability potentially affecting me. I'm using ProxyCommand because GitHub is randomly blocked by the China GFW.

This is interesting insight, would you care to share some parts of your ssh config indicating how you use ssh over a proxy here, most likely through a VPN?

```

Host github.com

    ProxyCommand connect -H localhost:54321 %h %p
```

localhost:54321 is a SOCK5 proxy, which forwards the traffic through TLS to my VPS server.

Re: SSH ProxyCommand == unexpected code execution (CVE-2023-51385)

#13
post #11
post #4

Earlier quoted context omitted.

> but honestly it's not far off that level of “well, duh” I think the real problem is that other apps do use ssh and malicious actors can inject untrusted input without the user's consent. The git POC is one example, and while I do think that git also needs to be updated, fixing the problem on the ssh side is also a good idea

OP here. Another interesting attack vector I have been working on is OSC 8 for hyperlink support in terminals. Mostly they allow arbitrary url schemes including "ssh://" without any prompt or user interaction to consent to open an external tool like ssh client in this case. A good discussion on this: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3c...

[deleted]

Re: SSH ProxyCommand == unexpected code execution (CVE-2023-51385)

#14
post #7

Wow, this is a security vulnerability potentially affecting me. I'm using ProxyCommand because GitHub is randomly blocked by the China GFW.

Try ProxyJump instead - it’s the newer way of doing it.

ProxyJump is to connect to one SSH server by another SSH, right? It doesn't work against GFW. GFW throttles SSH traffic across borders to ensure that SSH can only be used for running commands rather than tunneling data.

Re: SSH ProxyCommand == unexpected code execution (CVE-2023-51385)

#15
post #7

Earlier quoted context omitted.

Try ProxyJump instead - it’s the newer way of doing it.

ProxyJump is to connect to one SSH server by another SSH, right? It doesn't work against GFW. GFW throttles SSH traffic across borders to ensure that SSH can only be used for running commands rather than tunneling data.

Yeah I assumed that's what you were doing, since you mentioned Github blocked specifically. If you need to proxy through a protocol other than SSH, likely need to keep using ProxyCommand.

Re: SSH ProxyCommand == unexpected code execution (CVE-2023-51385)

#16

Wow, this is a security vulnerability potentially affecting me. I'm using ProxyCommand because GitHub is randomly blocked by the China GFW.

It doesn’t affect you as it only works when your proxy string comes from an untrusted source.
Post reply on HN