Live data from Hacker News

RegreSSHion: RCE in OpenSSH's server, on glibc-based Linux systems

qualys.com

301–310 of 347 posts

Re: RegreSSHion: RCE in OpenSSH's server, on glibc-based Linux systems

#301
post #263

Earlier quoted context omitted.

https://github.com/francoismichel/ssh3?tab=readme-ov-file

>However, we cannot yet endorse its appropriateness for production systems without further peer review. [0] Not an alternative and won't be for the foreseeable future. [0]: https://github.com/francoismichel/ssh3?tab=readme-ov-file#-s...

You are right for now. This is the last piece(ssh server) that needs to be solved for Go/Rust to prevail over the legacy systems.

Re: RegreSSHion: RCE in OpenSSH's server, on glibc-based Linux systems

#302
post #15

From the report: > Finally, if sshd cannot be updated or recompiled, this signal handler race condition can be fixed by simply setting LoginGraceTime to 0 in the configuration file. This makes sshd vulnerable to a denial of service (the exhaustion of all MaxStartups connections), but it makes it safe from the remote code execution presented in this advisory. Setting 'LoginGraceTime 0' in sshd_config file seems to mit…

would cold-restarting sshd every hour also make this unlikely / harder to exploit?

Re: RegreSSHion: RCE in OpenSSH's server, on glibc-based Linux systems

#303
post #237
post #213

Earlier quoted context omitted.

Has this fix been pushed to / pulled by distributions yet?

Fedora: not yet. https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2024-6387 (tracking task) https://bugzilla.redhat.com/show_bug.cgi?id=2294905 (Fedora 39 issue)

Fix pushed in openssh-9.3p1-11.fc39 and (in progress) openssh-9.6p1-1.fc40.4.

Re: RegreSSHion: RCE in OpenSSH's server, on glibc-based Linux systems

#304

Earlier quoted context omitted.

>As mentioned elsewhere here, is -D sufficient to avoid exploitation, or is -e necessary as well? https://github.com/openssh/openssh-portable/blob/V_9_8_P1/ss... sshd.c handles no_daemon (-D) and log_stderr (-e) independently. log_stderr is what is given to log_init in log.c that gates the call to syslog functions. There is a special case to set log_stderr to true if debug_flag (-d) is set, but nothing for no_daemon.…

So in other words, -De is not a workaround. -Dde might be but it will cause more log output than is wanted.

-De is a workaround. -D is not.

Re: RegreSSHion: RCE in OpenSSH's server, on glibc-based Linux systems

#305

> In our experiments, it takes ~10,000 tries on average to win this race condition, so ~3-4 hours with 100 connections (MaxStartups) accepted per 120 seconds (LoginGraceTime). Ultimately, it takes ~6-8 hours on average to obtain a remote root shell, because we can only guess the glibc's address correctly half of the time (because of ASLR). Mitigate by using fail2ban? Nice to see that Ubuntu isn't affected at all

fail2ban just means an attacker would need to use many source IPs, not hard.

Re: RegreSSHion: RCE in OpenSSH's server, on glibc-based Linux systems

#306
post #207

In some setups I decided to have jumphost via HAproxy ssl as described there https://www.haproxy.com/blog/route-ssh-connections-with-hapr... so no ssh directly exposed at all.

So this is effectively like ProxyJump, just with the jump node exposed over SSL and backed by HAProxy binary instead of OpenSSH? What benefits do you see? I mean, you still expose some binary that implements authentication and authorization using cryptography. I think that even RBAC scenarios described in the link above should be achievable with OpenSSH, right?

It's not about RBAC at all. Goal is not to expose ssh socket to the Internet! ssh tcp is encapsulated in https packet and ONLY after successful certificate auth by HAProxy.

Re: RegreSSHion: RCE in OpenSSH's server, on glibc-based Linux systems

#307
post #271

Earlier quoted context omitted.

> surely it doesn't touch any global (or per-thread) state Not necessarily. An implementation might choose to e.g. use some kind of cache similar to what the JVM does with interned strings, and then a function like strcmp() might behave badly if it happened to run while that cache was halfway through being rebuilt.

Contrived example, never seen in reality.

The JVM does it in reality, I can't see why a C runtime wouldn't.

Re: RegreSSHion: RCE in OpenSSH's server, on glibc-based Linux systems

#308

Earlier quoted context omitted.

Why can't you call strcmp? I think a general practice of "only call functions that are explicitly blessed as async-signal-safe" is a good idea, which means not calling strcmp as it hasn't been blessed, but surely it doesn't touch any global (or per-thread) state so how can it corrupt program state? Update: according to https://man7.org/linux/man-pages/man7/signal-safety.7.html strcmp() actually is async-signal-safe a…

That's the point. They weren't added until TC2 in 2016.

Right, it wasn't promised to be safe until then. That doesn't mean it was definitively unsafe before, just that you couldn't rely on it being safe. My question is how would a function like strcmp() actually end up being unsafe in practice given the trivial nature of what it does.

Re: RegreSSHion: RCE in OpenSSH's server, on glibc-based Linux systems

#309
post #271

Earlier quoted context omitted.

Why can't you call strcmp? I think a general practice of "only call functions that are explicitly blessed as async-signal-safe" is a good idea, which means not calling strcmp as it hasn't been blessed, but surely it doesn't touch any global (or per-thread) state so how can it corrupt program state? Update: according to https://man7.org/linux/man-pages/man7/signal-safety.7.html strcmp() actually is async-signal-safe a…

> surely it doesn't touch any global (or per-thread) state Not necessarily. An implementation might choose to e.g. use some kind of cache similar to what the JVM does with interned strings, and then a function like strcmp() might behave badly if it happened to run while that cache was halfway through being rebuilt.

A function like strcmp() cannot assume that if it sees the same pointer multiple times that this pointer contains the same data, so there's no opportunity for doing any sort of caching of results. The JVM has a lot more flexibility here in that it's working with objects, not raw pointers to arbitrary memory.

Re: RegreSSHion: RCE in OpenSSH's server, on glibc-based Linux systems

#310
post #293
post #209

Earlier quoted context omitted.

>scp, among other things, runs over ssh. Ironically scp/sftp caused me more bandwidth headaches than wireguard/openvpn. I frequently experienced cases where scp/sftp would get 10% or even less of the transfer speed compared to a plain http(s) connection. Maybe it was due to packet loss, buffer size, or qos/throttling, but I wasn't able to figure out a definitive solution.

In almost all cases, the reason is OpenSSH's silly limitation of buffer sizes [1]. It limits the amount of data that's "in the cable" (which needs to be more if the cable is long). > The default SSH window size was 64 - 128 KB, which worked well for interactive sessions, but was severely limiting for bulk transfer in high bandwidth-delay product situations. > OpenSSH later increased the default SSH window size to 2 M…

You can help by testing/reviewing https://github.com/djmdjm/openssh-wip/pull/29/commits/659cbc...
Post reply on HN