Security Advisory

CVE-2006-5051: OpenSSH Signal Handler Race

Last updated:
  • CVE-2006-5051

CVE-2006-5051 is a signal handler race in the sshd server of OpenSSH before 4.4. A remote, unauthenticated attacker can crash sshd, and on portable OpenSSH with GSSAPI authentication enabled it may lead to code execution through a double free. NVD scores it 8.1 (CWE-415). Fixed in OpenSSH 4.4. Qualys calls regreSSHion (CVE-2024-6387) a regression of this bug.

Vulnerability summary

CVSS base score

8.1

High severity

EPSS score (FIRST)

45.6%

Probability of exploitation in the wild in the next 30 days

CISA KEV catalog

No

Not listed

Published

Vulnerability ID: CVE-2006-5051 · Source: NVD

Affected components

ComponentCPEVersion range
OpenSSH (sshd)cpe:2.3:a:openbsd:openssh:*:*:*:*:*:*:*:*Before 4.4 (CVE description, OpenSSH 4.4 release notes); NVD CPE says up to and including 4.4. Fixed in 4.4. Per Qualys, 8.5p1 to before 9.8p1 regressed as CVE-2024-6387
Debian opensshcpe:2.3:o:debian:debian_linux:3.1:*:*:*:*:*:*:*Fixed in sarge 1:3.8.1p1-8.sarge.6 (DSA-1212-1) and etch 1:4.3p2-9etch3 (DSA-1638-1, which also fixes CVE-2008-4109); openssh-krb5 sarge 3.8.1p1-7sarge1 (DSA-1189-1) (Debian security tracker)
FreeBSD base system OpenSSH—All FreeBSD releases at the time; corrected 2006-09-30, e.g. 6.1-RELEASE-p10, 6.0-RELEASE-p15, 5.5-RELEASE-p8, 4.11-RELEASE-p25 (FreeBSD-SA-06:22)

What does this mean for affected devices?

OpenSSH's 4.4 release notes (released 2006-09-27) list the fix: "Fix an unsafe signal handler reported by Mark Dowd. The signal handler was vulnerable to a race condition that could be exploited to perform a pre-authentication denial of service. On portable OpenSSH, this vulnerability could theoretically lead to pre-authentication remote code execution if GSSAPI authentication is enabled, but the likelihood of successful exploitation appears remote." The FreeBSD advisory FreeBSD-SA-06:22 places the race in the handler for the LoginGraceTime option, where it "can potentially cause some cleanup routines to be executed multiple times". NVD's Primary score is 8.1, CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H, with CWE-415 (double free). No CNA or CISA ADP score is published. Red Hat is the CNA (NVD, CVE record).

Which OpenSSH versions and systems are affected?

The CVE description says "OpenSSH before 4.4". NVD's CPE configuration is wider and covers openbsd:openssh up to and including 4.4. It also lists Debian 3.1, Mac OS X and Mac OS X Server before 10.3.9, and 10.4 through 10.4.8. The 4.4 release notes put the fix in 4.4, so a 4.4p1 build matched by that CPE range is a false positive. CERT/CC's VU#851340 lists Apple, FreeBSD, Red Hat and Ubuntu as affected. It recommends upgrading, restricting access to the SSH daemon with firewall rules, or disabling the server when it is not needed. FreeBSD says there is no workaround and fixed all supported branches on 2006-09-30.

Is a backported patch always enough?

No. The Debian security tracker lists fixes in sarge 1:3.8.1p1-8.sarge.6 (DSA-1212-1), openssh-krb5 3.8.1p1-7sarge1 (DSA-1189-1) and etch 1:4.3p2-9etch3 (DSA-1638-1). The etch fix belongs to CVE-2008-4109, whose description says it exists "because of an incorrect fix for CVE-2006-5051". Debian's note says the backported patch "was incorrect and did not fully address the issue" and that the upstream fix in 4.4p1 was right. Firmware built on an old distribution package needs both fixes. Checking the upstream version string alone will not show this.

How is CVE-2006-5051 related to regreSSHion?

The Qualys advisory for CVE-2024-6387 says that bug "is in fact a regression of CVE-2006-5051". It was introduced in October 2020 in OpenSSH 8.5p1, when commit 752250c dropped the DO_LOG_SAFE_IN_SIGHAND guard that the CVE-2006-5051 patch had added to sigdie(). Qualys gives three ranges. Before 4.4p1 is vulnerable unless patched against CVE-2006-5051 and CVE-2008-4109. 4.4p1 to before 8.5p1 is not vulnerable. 8.5p1 to before 9.8p1 is vulnerable again. Qualys also writes that, to its knowledge, CVE-2006-5051 "has never been successfully exploited before". Its team then got a remote root shell on Ubuntu 6.06.1's OpenSSH 4.2p1 by going through PAM rather than GSSAPI. Our OpenSSH in embedded firmware guide covers version checks on devices. The memory corruption fix guide covers the double-free class, also seen in CVE-2020-11900.

Is CVE-2006-5051 exploited?

CVE-2006-5051 is not in the CISA KEV catalog as of 2026-11-19 (catalog version 2026.11.18). FIRST EPSS gives it 0.45588, the 98.8th percentile, in the 2026-11-18 dataset (CISA KEV, FIRST EPSS).

How to fix this class of issueNo dedicated SoftWSP guide covers this weakness class; the fix is usually the vendor patch or firmware update referenced above. Our related guide explains how to plan and verify it: NIST SP 800-40 Rev. 4: enterprise patch management planning, explained.

Evidence

  • NVD: [email protected] Primary CVSS 3.1 8.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H (CVSS 2.0 9.3), CWE-415; no CNA or ADP score; CPE openbsd:openssh up to and including 4.4, Debian 3.1, Mac OS X / Server before 10.3.9 and 10.4 to 10.4.8; published 2006-09-27, status Modified, read 2026-11-19. — NVD
  • CVE record: state PUBLISHED, CNA redhat, published 2006-09-27; description 'Signal handler race condition in OpenSSH before 4.4 ... double-free'. — CVE.org
  • OpenSSH 4.4 release notes (2006-09-27): fix for unsafe signal handler reported by Mark Dowd; race exploitable for pre-auth DoS; on portable OpenSSH could theoretically lead to pre-auth RCE if GSSAPI authentication is enabled. — OpenSSH
  • FreeBSD-SA-06:22.openssh (2006-09-30): race in the sshd signal handler for LoginGraceTime can cause cleanup routines to run multiple times; affects all FreeBSD releases; no workaround; corrected branches listed. — FreeBSD Security Advisory
  • CERT/CC VU#851340 (2006-10-04, revised 2007-03-13): race in signal handler before 4.4; affected Apple, FreeBSD, Red Hat, Ubuntu; solution upgrade, restrict access, disable server if not needed. — CERT/CC
  • Debian tracker CVE-2006-5051: openssh sarge 1:3.8.1p1-8.sarge.6 (DSA-1212-1), etch 1:4.3p2-9etch3 (DSA-1638-1), unstable 1:4.6p1-1; openssh-krb5 sarge 3.8.1p1-7sarge1 (DSA-1189-1). — Debian security tracker
  • Debian tracker CVE-2008-4109: issue exists because of an incorrect fix for CVE-2006-5051; note: backported patch was incorrect, upstream fix in 4.4p1 was right; etch fixed 1:4.3p2-9etch3 (DSA-1638-1). — Debian security tracker
  • Qualys regreSSHion advisory (2024-07-01): CVE-2024-6387 is a regression of CVE-2006-5051, introduced in OpenSSH 8.5p1 by commit 752250c removing DO_LOG_SAFE_IN_SIGHAND from sigdie(); <4.4p1 vulnerable unless patched against CVE-2006-5051/CVE-2008-4109, 4.4p1 to <8.5p1 not vulnerable, 8.5p1 to <9.8p1 vulnerable; CVE-2006-5051 never successfully exploited before to their knowledge; exploited OpenSSH 4.2p1 on Ubuntu 6.06.1 via PAM. — Qualys
  • Not in the CISA KEV catalog, version 2026.11.18 (1,786 entries), checked 2026-11-19. — CISA KEV
  • EPSS 0.45588, percentile 0.98819, dataset 2026-11-18, read 2026-11-19. — FIRST EPSS

Related advisories

Sources

  1. NVD
  2. CVE.org record CVE-2006-5051 (CNA: Red Hat)
  3. OpenSSH 4.4 release notes
  4. FreeBSD-SA-06:22.openssh: Multiple vulnerabilities in OpenSSH
  5. CERT/CC VU#851340: OpenSSH contains a race condition vulnerability
  6. Debian security tracker: CVE-2006-5051
  7. Debian security tracker: CVE-2008-4109
  8. Qualys: regreSSHion, remote unauthenticated code execution in OpenSSH's server (CVE-2024-6387)
  9. CISA KEV
  10. FIRST EPSS

Frequently asked questions

Which OpenSSH version fixes CVE-2006-5051?

OpenSSH 4.4, released 2006-09-27. NVD's CPE range includes 4.4 itself, but the CVE description and the OpenSSH 4.4 release notes place the fix in 4.4 (per NVD and OpenSSH).

Is CVE-2006-5051 the same bug as regreSSHion?

Not the same CVE, but the same code path. Qualys describes CVE-2024-6387 as a regression of CVE-2006-5051 that was introduced in OpenSSH 8.5p1 and fixed in 9.8p1. Versions 4.4p1 to before 8.5p1 are not affected by either (per the Qualys advisory).

Why can a patched Debian-based firmware still be vulnerable?

Debian's first backported fix was incomplete and became CVE-2008-4109, fixed for etch in 1:4.3p2-9etch3 (DSA-1638-1). An image built on an old package needs both fixes, and the version string alone will not show it (per the Debian security tracker).

Is CVE-2006-5051 exploited in the wild?

It is not in the CISA KEV catalog as of 2026-11-19 (catalog version 2026.11.18). FIRST EPSS gives it 0.45588, the 98.8th percentile, in the 2026-11-18 dataset. Qualys wrote in 2024 that, to its knowledge, it had never been successfully exploited before its own research (per CISA KEV, FIRST EPSS and Qualys).