Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
regreSSHion (CVE-2024-6387) is an unauthenticated remote root vulnerability in OpenSSH caused by a signal handler race condition—a bug fixed in 2006 and accidentally reintroduced in 2020.

What Is regreSSHion?
regreSSHion is CVE-2024-6387, an unauthenticated remote code execution vulnerability in the OpenSSH server, disclosed by the Qualys Threat Research Unit on 1 July 2024. It allows an attacker who can reach the SSH port to execute code as root without any credentials. The name combines “regression” with SSH, because the underlying defect had been found and fixed eighteen years earlier and was then reintroduced by an unrelated code change.
OpenSSH limits how long a client may take to authenticate, controlled by LoginGraceTime and set to 120 seconds by default. When that timer expires, the server raises SIGALRM, and the signal handler logs the failure and terminates the connection.
Signal handlers run asynchronously, interrupting whatever the process was doing. That imposes a strict rule: a handler may only call functions that are async-signal-safe. The OpenSSH handler calls syslog, which is not—it allocates memory through malloc. If the alarm fires while the main thread is already inside a memory allocation routine, the allocator’s internal state is re-entered mid-update and corrupted.
Qualys showed that an attacker who controls the timing and content of the data sent before the timeout can shape that corruption into arbitrary code execution. The process is running as root at that point, because privilege separation has not yet dropped privileges for an unauthenticated connection on glibc-based Linux systems.
The identical issue was reported in 2006 as CVE-2006-5051 and addressed by wrapping the unsafe call in a compile-time guard, DO_LOG_SAFE_IN_SIGHAND. In October 2020, during refactoring for OpenSSH 8.5p1, that directive was removed. Nobody noticed that it had been load bearing.
The affected range is therefore specific: OpenSSH 8.5p1 up to and including 9.7p1 on glibc-based Linux are vulnerable. Versions from 4.4p1 up to 8.5p1 are not, because the guard was present. OpenBSD is unaffected entirely, since it has had a safe syslog implementation since 2001. Systems using musl, such as Alpine Linux, are not exploitable by the published method.
This is a useful argument for keeping regression tests for security fixes, not merely for functionality. A test that confirmed the guard was still compiled in would have caught the change in 2020.
Harder than the severity suggests, at least initially. Qualys demonstrated the attack on 32-bit x86 with ASLR enabled, requiring roughly 10,000 connection attempts and six to eight hours of continuous effort against a single target. No working 64-bit exploit was published at disclosure, though the researchers expected one to follow given time.
That difficulty bought defenders breathing room, but it should not be read as safety. Exploitation is noisy—thousands of connections that fail to authenticate—so an unpatched server with any log monitoring at all should produce an obvious signal, which is unusual and worth taking advantage of.
LoginGraceTime 0 in sshd_config. This disables the timeout and so prevents the signal from ever firing. Understand the trade-off: unauthenticated connections are then never timed out, so the server becomes vulnerable to connection exhaustion. Pair it with a tight MaxStartups setting.regreSSHion sits with PwnKit and Looney Tunables as another Qualys finding in long-trusted privileged code. The specific lesson here is different from theirs, though: this was not an undiscovered bug but a known one that came back. Security-relevant code deserves comments explaining why it exists and tests that fail if it is removed, because the next maintainer will not have the context that the original author did.
Our Infrastructure Security Testing Services include external exposure review, which routinely finds SSH reachable from the internet on hosts where nobody intended it to be.
OpenSSH 8.5p1 through 9.7p1 on glibc-based Linux systems. Versions from 4.4p1 up to but not including 8.5p1 are not vulnerable, because the protective compile-time guard was present during that period. OpenBSD is unaffected, and systems using the musl C library, such as Alpine Linux, are not exploitable by the published technique. Always confirm against your distribution’s own advisory.
It prevents exploitation, because the alarm signal that triggers the race never fires, but it introduces a denial of service risk. Unauthenticated connections are no longer timed out, so an attacker can hold open connection slots until the server refuses new sessions. If you use it as a temporary measure, reduce MaxStartups accordingly and patch as soon as a maintenance window allows.
The 2006 fix was a compile-time directive that kept an unsafe logging call out of the signal handler. During a 2020 refactor the directive was removed, which looked like tidying up dead configuration rather than deleting a security control. There was no test that failed when it disappeared, so the regression went unnoticed through nearly four years of releases.
Rarely. Most organisations can place SSH behind a VPN or a bastion host and restrict access by source address, which removes exposure to this class of vulnerability entirely. Where internet exposure is unavoidable, use key-based authentication only, disable password authentication, apply rate limiting, and monitor for the connection patterns that unsuccessful exploitation produces.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.