OpenSSH Server (sshd) Signal Handler Race Condition (regreSSHion)
A regression in OpenSSH signal handling creates an unauthenticated remote code execution race condition as root on glibc Linux hosts.

- CVE Identifier
- CVE-2024-6387
- CVSS v3.1 Base Score
- 8.1 (High)
- Published Date
- Jul 1, 2024
- Scope / Region
- Global
- Affected Products
- OpenSSH sshd (8.5p1–9.7p1 on glibc Linux)
Technical Summary
CVE-2024-6387, scored 8.1 High under CVSS v3.1, reintroduces a signal handler race condition in sshd when a client fails to authenticate within LoginGraceTime (default 120 seconds). Affecting OpenSSH versions 8.5p1 through 9.7p1 on glibc-based Linux systems, successful exploitation yields root code execution without credentials.
The vulnerability was fixed in OpenSSH 9.8p1 and backported across major Linux distributions; setting LoginGraceTime to 0 in sshd_config mitigates the race condition at the trade-off of potential connection-slot exhaustion.
Defender Briefing: Mechanism, Impact & Response
What Happened
- A regression of CVE-2006-5051 introduced in Portable OpenSSH 8.5p1 caused `sshd(8)` to call async-signal-unsafe functions (such as `syslog()` / `malloc()`) inside the `SIGALRM` handler when unauthenticated clients exceed `LoginGraceTime` (OpenSSH 9.8).
- Exploitation was demonstrated on 32-bit Linux/glibc systems with ASLR, requiring roughly 6–8 hours of continuous connection attempts in lab testing; OpenBSD is not vulnerable (OpenSSH 9.8).
Impact
- CVSS v3.1 base score 8.1 High (`AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`); successful exploitation grants unauthenticated remote code execution as root on affected glibc Linux hosts (NVD).
What to Do
- Upgrade to OpenSSH 9.8p1 (which splits `sshd` and adds `PerSourcePenalties`) or apply your Linux distribution's backported security update (OpenSSH 9.8).
- Where immediate patching is impossible, set `LoginGraceTime 0` in `/etc/ssh/sshd_config` (which prevents the signal-handler race at the risk of connection-slot exhaustion) and restrict SSH access at the network perimeter (OpenSSH 9.8).
Disclosure & Patch Timeline
- Publicly disclosed and patched in OpenSSH 9.8p1 alongside distribution security backports.
Public References
- Red Hat CNA / CVE Program (Primary Record):https://www.cve.org/CVERecord?id=CVE-2024-6387 →
- OpenSSH 9.8 Release Notes:https://www.openssh.com/txt/release-9.8 →
- NVD Vulnerability Record (CVE-2024-6387):https://nvd.nist.gov/vuln/detail/CVE-2024-6387 →
- Qualys TRU: regreSSHion RCE in OpenSSH Server:https://blog.qualys.com/vulnerabilities-threat-research/2024/07/01/regresshion-remote-unauthenticated-code-execution-vulnerability-in-openssh-server →


