# CVE-2024-6387 (regreSSHion): Openssh: regresshion - race condition in ssh allows rce/dos

> Unauthenticated remote attackers can exploit a race condition in OpenSSH to achieve remote code execution or cause denial of service.

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Jul 2024
- **Updated:** 15 Oct 2026
- **Also known as:** ALPINE-CVE-2024-6387, ALSA-2024:4312, AZL-43024, AZL-43030, BELL-CVE-2024-6387, CLSA-2024-1720093829, DEBIAN-CVE-2024-6387, DSA-5724-1, GHSA-2x8c-95vh-gfv4, JLSEC-2026-71, MGASA-2024-0250, OESA-2024-1781, OESA-2024-1782, OESA-2024-1783, OESA-2024-1784, RHSA-2024:4312, RHSA-2024:4340, RHSA-2024:4389, SUSE-SU-2024:2275-1, SUSE-SU-2024:2275-2, UBUNTU-CVE-2024-6387, USN-6859-1, openSUSE-SU-2024:14088-1

## What is CVE-2024-6387?

CVE-2024-6387 (regreSSHion) is a high-severity vulnerability in Apple Macos, published on 1 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization), CWE-364 (Signal Handler Race Condition)

## Which versions are affected by CVE-2024-6387?

It affects 53 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openssh` | AlmaLinux:9 | All versions | 8.7p1-38.el9_4.1 |
| `openssh-askpass` | AlmaLinux:9 | All versions | 8.7p1-38.el9_4.1 |
| `openssh-clients` | AlmaLinux:9 | All versions | 8.7p1-38.el9_4.1 |
| `openssh-keycat` | AlmaLinux:9 | All versions | 8.7p1-38.el9_4.1 |
| `openssh-server` | AlmaLinux:9 | All versions | 8.7p1-38.el9_4.1 |
| `pam_ssh_agent_auth` | AlmaLinux:9 | All versions | 0.10.4-5.38.el9_4.1 |
| `openssh-askpass` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-askpass-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-clients-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-keycat-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-server-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-sk-dummy-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:8.7p1-38.el9_4.1 |
| `pam_ssh_agent_auth` | Red Hat:enterprise_linux:9::appstream | All versions | 0:0.10.4-5.38.el9_4.1 |
| `pam_ssh_agent_auth-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:0.10.4-5.38.el9_4.1 |
| `openssh` | Red Hat:enterprise_linux:9::baseos | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-askpass-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-clients` | Red Hat:enterprise_linux:9::baseos | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-clients-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-debugsource` | Red Hat:enterprise_linux:9::baseos | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-keycat` | Red Hat:enterprise_linux:9::baseos | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-keycat-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-server` | Red Hat:enterprise_linux:9::baseos | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-server-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:8.7p1-38.el9_4.1 |
| `openssh-sk-dummy-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:8.7p1-38.el9_4.1 |
| `pam_ssh_agent_auth-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:0.10.4-5.38.el9_4.1 |
| `openssh-askpass` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:8.7p1-12.el9_0.1 |
| `openssh-askpass-debuginfo` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:8.7p1-12.el9_0.1 |
| `openssh-clients-debuginfo` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:8.7p1-12.el9_0.1 |
| `openssh-debuginfo` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:8.7p1-12.el9_0.1 |
| `openssh-debugsource` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:8.7p1-12.el9_0.1 |
| `openssh-keycat-debuginfo` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:8.7p1-12.el9_0.1 |
| `openssh-server-debuginfo` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:8.7p1-12.el9_0.1 |
| `pam_ssh_agent_auth` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:0.10.4-4.12.el9_0.1 |
| `pam_ssh_agent_auth-debuginfo` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:0.10.4-4.12.el9_0.1 |
| `openssh` | Red Hat:rhel_e4s:9.0::baseos | All versions | 0:8.7p1-12.el9_0.1 |
| `openssh-askpass-debuginfo` | Red Hat:rhel_e4s:9.0::baseos | All versions | 0:8.7p1-12.el9_0.1 |
| `openssh-clients` | Red Hat:rhel_e4s:9.0::baseos | All versions | 0:8.7p1-12.el9_0.1 |

Products: Almalinux Almalinux, Amazon Amazon Linux, Apple Macos, Arista Eos, Canonical Ubuntu Linux, Debian Debian Linux, Freebsd Freebsd, Netapp 500f Firmware, Netapp 8300 Firmware, Netapp 8700 Firmware, Netapp A150 Firmware, Netapp A1k Firmware, Netapp A220 Firmware, Netapp A250 Firmware, Netapp A400 Firmware, Netapp A700s Firmware, Netapp A70 Firmware, Netapp A800 Firmware, Netapp A900 Firmware, Netapp A90 Firmware and 33 more.

## How do I fix CVE-2024-6387?

Apply the vendor's patch.

## Is CVE-2024-6387 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-6387 exists.

Public exploit code:

- CVE-2024-6387_Check is a lightweight, efficient tool designed to identify servers running vulnerable versions of OpenSSH (github_poc): https://github.com/xaitax/CVE-2024-6387_Check
- a signal handler race condition in OpenSSH's server (sshd) (github_poc): https://github.com/zgzhang/cve-2024-6387-poc
- 32-bit PoC for CVE-2024-6387 — mirror of the original 7etsuo/cve-2024-6387-poc (github_poc): https://github.com/acrono/cve-2024-6387-poc
- Remote Unauthenticated Code Execution Vulnerability in OpenSSH server (CVE-2024-6387) (github_poc): https://github.com/Karmakstylez/CVE-2024-6387
- MIRROR of the original 32-bit PoC for CVE-2024-6387 "regreSSHion" by 7etsuo/cve-2024-6387-poc (github_poc): https://github.com/lflare/cve-2024-6387-poc
- PoC - Remote Unauthenticated Code Execution Vulnerability in OpenSSH server (Scanner and Exploit)  (github_poc): https://github.com/l0n3m4n/CVE-2024-6387

## Other vulnerabilities in Apple Macos

- [CVE-2024-12084](https://insights.sbomify.com/CVE-2024-12084/): Rsync: heap buffer overflow in rsync due to improper checksum length handling (critical 9.8)
- [CVE-2024-12085](https://insights.sbomify.com/CVE-2024-12085/): Rsync: info leak via uninitialized stack contents (high 7.5)
- [CVE-2024-12087](https://insights.sbomify.com/CVE-2024-12087/): Rsync: path traversal vulnerability in rsync (medium 6.5)
- [CVE-2024-12088](https://insights.sbomify.com/CVE-2024-12088/): Rsync: --safe-links option bypass leads to path traversal (medium 6.5)
- [CVE-2024-12086](https://insights.sbomify.com/CVE-2024-12086/): Rsync: rsync server leaks arbitrary client files (medium 6.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-6387 (regreSSHion) and fix it if it is affected.

What it is: CVE-2024-6387 (regreSSHion) is a high-severity vulnerability in Apple Macos, published on 1 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-6387 exists.

Affected product: Apple Macos. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-6387/ (Markdown: https://insights.sbomify.com/CVE-2024-6387/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-6387
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-6387
- OSV: https://osv.dev/vulnerability/CVE-2024-6387

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-6387/
Summaries are generated and may contain mistakes; the official description above is the record.
