On July 1, Qualys disclosed CVE-2024-6387, which it named "regreSSHion": an unauthenticated remote code execution flaw in the OpenSSH server on glibc-based Linux. The name is the story. The bug is a signal-handler race that OpenSSH fixed in 2006 as CVE-2006-5051, and that a change to OpenSSH's logging code quietly reintroduced in October 2020. The regression first shipped in 8.5p1 the following March.
That makes this an unusual week for vulnerability management. The systems most exposed are not the neglected ones. They are the ones you kept current.
What was actually disclosed
The coverage has been loud, so the facts, briefly:
- Affected: Portable OpenSSH 8.5p1 through 9.7p1 on glibc-based Linux. Versions from 4.4p1 up to 8.5p1 are not affected; very old builds that never received the 2006 fixes are. OpenBSD is not affected.
- Fixed: OpenSSH 9.8p1, released the same day. Most distributions are backporting the fix into the versions they already ship, so a patched server will often not say 9.8.
- Pre-authentication, default configuration. The race fires when a client fails to authenticate inside the login grace period. No credentials, no user interaction.
- Hard, not hypothetical. Qualys reached root on 32-bit Linux with ASLR after six to eight hours of continuous connections, on average. The OpenSSH project says exploitation on 64-bit systems is believed possible but had not been demonstrated at release.
- Scale. Qualys counted over 14 million potentially vulnerable OpenSSH instances exposed to the internet.
Then, on July 8, Solar Designer posted a related flaw, CVE-2024-6409: a similar race in the privilege-separated child process, affecting OpenSSH 8.7 and 8.8 builds that carry a downstream audit patch, notably RHEL 9, its rebuilds and some Fedora releases. Once researchers start pulling a thread, its siblings tend to follow.
Why "hard to exploit" is not a reason to wait
From where my team sits, six to eight hours of connections does not sound like a lot. It sounds like a cron job.
Time on target is cheap when nobody is waiting at the keyboard. A race won once in thousands of attempts is a numbers game, and numbers games favour whoever has more machines and more patience. Mass scanning of SSH is constant background noise on the internet already; adding a slow, automated attempt to that noise costs an attacker very little.
The 64-bit caveat deserves the same scepticism. "Not demonstrated at this time" is a statement about one research team's timeline, not about the bug. We plan as though it will be.
What the difficulty does buy you is time: days to weeks rather than hours. Spend it patching properly, not deferring.
Your hardened SSH configuration does not help
This is the point we have explained to clients most often this week.
Organizations that hardened SSH well — key-only authentication, no root login, no passwords — reasonably feel good about it. But this flaw lives before authentication. The server is vulnerable while it is still deciding whether to talk to you. Key-only auth, disabled root login, MFA on the bastion: none of it is ever reached.
For pre-authentication bugs, the controls that matter are the ones that decide who can reach the port at all:
- Source restriction. SSH reachable only from your VPN, a bastion or a short list of known addresses.
- Off the internet entirely. Most organizations with SSH exposed do not need it to be; it is a habit from before identity-aware proxies and cloud session managers made it unnecessary.
- Rate limiting. OpenSSH 9.8 added PerSourcePenalties, on by default, which penalises addresses that repeatedly fail to complete authentication. Useful depth; not a substitute for the patch.
The emergency mitigation, setting LoginGraceTime to 0, closes the code-execution path but lets anyone exhaust the connection slots and deny service. Acceptable for a few days on a box you cannot patch yet, with the trade-off written down and an owner attached.
Where sshd actually lives
Our first sweep across client external ranges after disclosure found sshd answering on the internet in a little under half of environments, and in most of those on at least one host nobody had listed as needing it. The usual places:
- Cloud VMs launched from a default image with port 22 open "temporarily".
- Appliances. Firewalls, storage arrays, backup appliances and hypervisor management interfaces embed OpenSSH and patch on their vendor's schedule, not yours.
- Containers and CI runners built on base images nobody has rebuilt since spring.
- SFTP endpoints stood up for one partner, years ago.
Two practical notes. Version numbers mislead: a patched Debian 12 server still reports upstream 9.2p1, and only the distribution's package revision says whether the fix is in. A scanner keyed on the upstream number will flag patched servers and teach people to ignore it. Check the package version against your distribution's advisory. And for appliances, ask vendors directly and in writing. Silence is not "not affected".
The regression lesson, for anyone who ships code
The deeper story belongs to engineering. A 2006 fix was undone by a 2020 change that Qualys traces to a revision of OpenSSH's logging infrastructure — a refactor that accidentally removed a small guard keeping one logging path safe to call from inside a signal handler. Qualys's own advisory calls OpenSSH one of the most secure pieces of software in the world. If a project with that discipline can lose a fix, so can yours, and so can your vendors.
The defence is old-fashioned: every security fix gets a regression test, kept next to the code it protects, with a comment saying what it guards against and why. A fix without a test is a note in the commit history, and commit history does not run in CI.
What to do this week, and this quarter
- Patch from your distribution and confirm by package version, not banner.
- Close port 22 to the internet wherever it does not need to be open; source-restrict wherever it does.
- Chase appliance vendors for a written answer and a date.
- Watch the logs. This class of attack needs a great many connections that time out before authenticating. A sustained run of pre-authentication timeouts from one source is worth an alert regardless of this CVE.
- Write the missing tests. Pick your last three security fixes in code you own and check whether anything would fail if they were reverted.
A fixed bug is a fact about a past release. Whether it stays fixed is a decision you keep making.
Sources
- regreSSHion: Remote Unauthenticated Code Execution Vulnerability in OpenSSH server — Qualys, July 2024
- Qualys Security Advisory: regreSSHion, RCE in OpenSSH's server, on glibc-based Linux systems (CVE-2024-6387) — Qualys, July 2024
- OpenSSH 9.8 release notes — OpenSSH, July 2024
- Re: CVE-2024-6387: RCE in OpenSSH's server, on glibc-based Linux systems (disclosure of CVE-2024-6409) — Solar Designer, oss-security, July 2024






