CVE Vulnerabilities

CVE-2024-6387

Signal Handler Race Condition

Published: Jul 01, 2024 | Modified: Nov 21, 2024
CVSS 3.x
8.1
HIGH
Source:
NVD
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.x
RedHat/V2
RedHat/V3
8.1 IMPORTANT
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Ubuntu
HIGH

A security regression (CVE-2006-5051) was discovered in OpenSSHs 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.

Weakness

The product uses a signal handler that introduces a race condition.

Affected Software

Name Vendor Start Version End Version
Openssh Openbsd * 4.4 (excluding)
Openssh Openbsd 8.6 (including) 9.8 (excluding)
Openssh Openbsd 4.4 (including) 4.4 (including)
Openssh Openbsd 8.5-p1 (including) 8.5-p1 (including)
Red Hat Enterprise Linux 9 RedHat openssh-0:8.7p1-38.el9_4.1 *
Red Hat Enterprise Linux 9 RedHat openssh-0:8.7p1-38.el9_4.1 *
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions RedHat openssh-0:8.7p1-12.el9_0.1 *
Red Hat Enterprise Linux 9.2 Extended Update Support RedHat openssh-0:8.7p1-30.el9_2.4 *
Red Hat OpenShift Container Platform 4.13 RedHat rhcos-413.92.202407091321-0 *
Red Hat OpenShift Container Platform 4.14 RedHat rhcos-414.92.202407091253-0 *
Red Hat OpenShift Container Platform 4.15 RedHat rhcos-415.92.202407091355-0 *
Red Hat OpenShift Container Platform 4.16 RedHat rhcos-416.94.202407081958-0 *
Openssh Ubuntu devel *
Openssh Ubuntu jammy *
Openssh Ubuntu mantic *
Openssh Ubuntu noble *
Openssh Ubuntu upstream *
Openssh-ssh1 Ubuntu upstream *

Extended Description

Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions. These race conditions have a variety of root causes and symptoms. Attackers may be able to exploit a signal handler race condition to cause the product state to be corrupted, possibly leading to a denial of service or even code execution. These issues occur when non-reentrant functions, or state-sensitive actions occur in the signal handler, where they may be called at any time. These behaviors can violate assumptions being made by the “regular” code that is interrupted, or by other signal handlers that may also be invoked. If these functions are called at an inopportune moment - such as while a non-reentrant function is already running - memory corruption could occur that may be exploitable for code execution. Another signal race condition commonly found occurs when free is called within a signal handler, resulting in a double free and therefore a write-what-where condition. Even if a given pointer is set to NULL after it has been freed, a race condition still exists between the time the memory was freed and the pointer was set to NULL. This is especially problematic if the same signal handler has been set for more than one signal – since it means that the signal handler itself may be reentered. There are several known behaviors related to signal handlers that have received the label of “signal handler race condition”:

Signal handler vulnerabilities are often classified based on the absence of a specific protection mechanism, although this style of classification is discouraged in CWE because programmers often have a choice of several different mechanisms for addressing the weakness. Such protection mechanisms may preserve exclusivity of access to the shared resource, and behavioral atomicity for the relevant code:

Potential Mitigations

References