OpenSSH server signal-handler race enables unauthenticated remote code execution

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2024-6387?

CVE-2024-6387 is a vulnerability classified as Signal Handler Race Condition, affecting Red Hat Enterprise Linux 9, Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions, Red Hat Enterprise Linux 9.2 Extended Update Support, and 5 more products. This vulnerability is rated High, with a CVSS score of 8.1. Public exploit code or evidence is available for this vulnerability, but that does not confirm exploitation in the wild.

Overview

Original source data

A security regression (CVE-2006-5051) was discovered in OpenSSH's server (sshd). There is a race condition which can lead sshd to handle some signals in an unsafe manner. An unauthenticated, remote attacker may be able to trigger it by failing to authenticate within a set time period.

Affected products and scope

  • Upstream OpenSSH: Portable OpenSSH versions 8.5p1 through 9.7p1, inclusive, are affected. The upstream fix is included in OpenSSH 9.8.
  • Red Hat Enterprise Linux 9: Red Hat identifies RHEL 9 as affected. The standard RHEL 9 update was published through RHSA-2024:4312; the reviewed advisory lists openssh packages at build 8.7p1-38.el9_4.1 for the RHEL 9.4 branch.
  • Red Hat Enterprise Linux 9.2 Extended Update Support: The fix was published through RHSA-2024:4340, with build 8.7p1-30.el9_2.4 listed in the reviewed advisory.
  • Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions: The fix was published through RHSA-2024:4389, with build 8.7p1-12.el9_0.1 listed in the reviewed advisory.
  • Red Hat OpenShift Container Platform: Branches 4.13, 4.14, 4.15, and 4.16 are affected because they include the vulnerable OpenSSH component in RHCOS. The corresponding fixes are delivered in releases 4.13.45, 4.14.33, 4.15.22, and 4.16.3.
  • Red Hat states that RHEL 6, RHEL 7, RHEL 8, and OpenShift Container Platform 4.12 and earlier are not affected by this issue. The normalized record also contains a generic OpenShift 4 CPE, so administrators should use the specific product branch and advisory rather than treating every OpenShift 4 release as affected.

Technical details

OpenSSH server (sshd) starts a timer for connections that have not completed authentication. When a client fails to authenticate within LoginGraceTime, set to 120 seconds by default, the SIGALRM handler may run asynchronously while performing operations that are unsafe in a signal-handler context, including syslog(). The flaw is a regression caused by a logging change that removed the guard around sigdie(), a function directly called by the SIGALRM handler. An attacker controls unauthenticated SSH connections and their timing relative to the grace-period expiration; no account or user interaction is required. On glibc-based Linux systems, the flaw can lead to remote code execution as root because the affected part of sshd runs with high privileges, but reliability depends on the race condition, ASLR, architecture, and downstream changes. Exploitability on other libc implementations or operating systems is not fully established by the evidence reviewed.

Exploitability

The flaw is reachable over the network before SSH authentication completes, without credentials and without user interaction. Exploitation depends on an unpredictable race condition, requires repeated attempts and substantial resources, and is therefore not equally reliable across systems. OpenSSH documents successful laboratory exploitation on 32-bit Linux with glibc and ASLR, using continuous connections for several hours; exploitation on 64-bit systems was considered possible but had not been demonstrated in that notice. The supplied record marks public exploit as true, but it does not establish in-the-wild exploitation, a specific campaign, or a specific victim. Setting LoginGraceTime 0 can reduce the remote-code-execution risk on Red Hat Enterprise Linux 9, but connection exhaustion can still produce denial of service.

Technical impact

  • Successful exploitation may provide remote code execution as root in the sshd process, allowing control of the host and access to resources available to root.
  • Possible technical outcomes include loss of confidentiality, unauthorized changes to data or configuration, installation of unauthorized code, and service disruption. These are consequences of root-level execution, not evidence of a specific compromise.
  • If exploitation only achieves connection exhaustion, or if the documented mitigation is in place, the practical effect may be limited primarily to loss of SSH service availability.
  • Real-world exploitability is constrained by the race condition, ASLR, NX, system architecture, and downstream backports. OpenSSH confirmed laboratory exploitation for a specific system class but did not establish the same reliability for every 64-bit system, libc implementation, or operating system.

Business impact

  • A successful attack against an SSH server could provide root-level control of the host, creating a risk to the confidentiality, integrity, and availability of that system and the services it administers.
  • Even without code execution, the flaw can disrupt SSH availability or exhaust connection capacity, especially when an unsuitable mitigation is used.
  • For OpenShift, remediation is delivered through platform releases and images because the affected OpenSSH component is present in the underlying RHCOS operating system. Clusters that have not consumed the relevant release should be handled as exposed at the platform layer.
  • The available evidence does not confirm a breach, data loss, or specific campaign; actual consequences depend on network exposure, host privileges, and additional defensive controls.

Remediation

  1. Install the branch-specific fix. For upstream deployments, upgrade OpenSSH to 9.8. For RHEL 9 and its EUS or E4S branches, install openssh and openssh-server from the applicable Red Hat erratum rather than substituting an unsupported upstream build. For OpenShift, upgrade through the supported release channel to 4.13.45, 4.14.33, 4.15.22, or 4.16.3, as applicable to the running branch.
  2. If RHEL 9 cannot yet be updated, apply the temporary mitigation: set LoginGraceTime 0 in /etc/ssh/sshd_config, then restart the service with systemctl restart sshd.service. This reduces the remote-code-execution risk but does not remove denial-of-service risk from connection exhaustion.
  3. When using the temporary mitigation, combine it with a firewall and connection or log-management tooling such as fail2ban as advised by Red Hat. Do not treat LoginGraceTime 0 as a complete fix.
  4. After installing the update, recheck the configuration because Red Hat notes that package installation does not automatically remove the mitigation. Restore LoginGraceTime to 120 or another operationally appropriate value after the fix has been verified.
  5. Verify the result on both standalone SSH servers and OpenShift RHCOS nodes or images. Do not infer the status of an unverified parallel branch from a fix released for a different branch.

Detection

  1. Inventory network-reachable SSH servers and identify the installed openssh or openssh-server package version; evaluate upstream, Red Hat Enterprise Linux, and OpenShift branches separately.
  2. Inspect /etc/ssh/sshd_config for LoginGraceTime. A value of 0 is a temporary mitigation, not evidence that the package is patched, and it retains connection-exhaustion risk.
  3. On Red Hat Enterprise Linux, verify that the installed package corresponds to the erratum for the operating-system branch. On OpenShift, verify that the cluster is running a release containing the fix and the corresponding RHCOS images.
  4. Review SSH telemetry for repeated unauthenticated connections that remain open until the grace period expires, repeated retry patterns, or unusual connection volume. Treat these as precautionary monitoring signals, not confirmed indicators of compromise.
  5. No specific log event or IOC in the reviewed evidence is sufficient to confirm or exclude exploitation. Absence of the described activity in logs does not prove that a system is safe.
Sources (29)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.