CVE-2023-25136
Medium · 6.5CVSS
6.5
EPSS
89.8%
Published
Feb 3, 2023
CISA due date
—
Cloudanix analysis
Attackers may be able to crash vulnerable remote login services without needing a password, disrupting administrators and automated operations.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- High
- Impact
- Denial Of Service
- Component
- Network Service
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
OpenSSH sshd 9.1 contains a pre-authentication double-free in handling of options.kex_algorithms during key-exchange compatibility processing. A remote unauthenticated client can trigger the vulnerable code path during SSH protocol negotiation, before login, causing memory corruption in the sshd process. The most realistic impact is daemon crash or instability, resulting in denial of service; public research has also described limited control-flow influence and theoretical remote code execution, but practical exploitation is high-complexity because modern OpenSSH privilege separation, sandboxing, ASLR, allocator behavior, and process isolation substantially constrain exploitation.
Why it matters to the business
Internet-facing SSH services running vulnerable OpenSSH builds may be remotely crashed or destabilized without valid credentials, potentially interrupting administrative access, automation, file transfer jobs, backups, and emergency response operations. Because SSH is widely deployed on servers, appliances, network devices, containers, and embedded Linux distributions, exposure can be broad even when the vulnerable version is present through downstream packages. The EPSS score is very high and exploit material is available, so organizations should treat remaining OpenSSH 9.1 exposure as urgent even though this is not currently listed in CISA KEV and is not known as ransomware-driven.
How an attack unfolds
An attacker connects to a reachable sshd service and completes enough of the SSH handshake to influence compatibility and key-exchange algorithm handling. By using a crafted client identification string and negotiation sequence that reaches the vulnerable options.kex_algorithms path, the attacker causes sshd to free the same memory more than once. In common outcomes, the affected pre-authentication sshd child process aborts or crashes, which can produce connection failures and service instability. In a more advanced scenario, an attacker would attempt heap shaping across repeated connections to convert the double-free into controlled memory corruption and redirect execution, although this is considered difficult and highly dependent on platform, allocator, hardening, and OpenSSH sandbox configuration.
How to fix it
Upgrade OpenSSH to version 9.2 or later, or apply the vendor/distribution security update that backports the fix. For source builds of openssh-portable, ensure the tree includes commit 486c4dc3b83b4b67d663fb0fa62bc24138ec3946 or an equivalent downstream patch. Because many Linux distributions backport security fixes without changing the upstream version string, validate using the package changelog or vendor advisory rather than relying only on the SSH banner. If immediate patching is not possible, reduce exposure by restricting SSH to trusted management networks or VPNs, enforcing firewall allowlists, disabling direct Internet exposure, rate-limiting new SSH connections, and ensuring privilege separation, sandboxing, ASLR, and system hardening remain enabled. Restart sshd after patching where required and confirm existing listener processes are running the patched binary.
How to confirm the fix worked
Confirm no SSH listener is running vulnerable OpenSSH 9.1 code. Use package manager metadata, vendor advisories, and changelogs to verify the installed OpenSSH package includes the fix or is based on OpenSSH 9.2 or later. For source deployments, verify the openssh-portable commit includes 486c4dc3b83b4b67d663fb0fa62bc24138ec3946 or the equivalent patch. Remotely fingerprint SSH banners as a triage step, but do not treat the banner as authoritative because banners can be customized and distro packages may be backported. After patching, restart sshd and confirm the running process path and package version match the patched package. Review system journals for recent sshd crashes before and after remediation to confirm exploit attempts are no longer causing abnormal process exits.
Typical attack path
- Identify hosts exposing SSH, typically TCP/22 or another configured SSH port.
- Fingerprint the SSH banner and package level to find OpenSSH 9.1 or vulnerable downstream builds.
- Open repeated unauthenticated SSH connections using crafted protocol banners and key-exchange negotiation parameters that trigger the compatibility handling bug.
- Cause the vulnerable sshd pre-authentication process to double-free options.kex_algorithms.
- Observe daemon crashes, failed handshakes, or service degradation; in advanced attempts, iterate heap-shaping attempts to seek code execution despite mitigations.
- If exploitation produces a crash only, repeat connections to create denial of service or operational disruption.
How to detect it
Look for evidence of pre-authentication sshd instability rather than successful logins, because exploitation occurs before authentication and may leave limited application-level traces. Review systemd journal, syslog/auth logs, kernel logs, crash reporters, and EDR telemetry for sshd crashes, aborts, segmentation faults, malloc/free errors, core dumps, or repeated sshd restarts. Correlate crash timestamps with inbound TCP connections to SSH ports from the same source addresses in firewall, load balancer, NetFlow, Zeek, or packet-capture data. Search for unusual or repeated SSH client identification strings associated with compatibility code paths, especially rare clients such as FuTTY, and for high rates of incomplete SSH handshakes. Because a successful advanced memory-corruption exploit may not create a distinctive log entry, also review for unexpected child processes spawned by sshd, anomalous outbound network connections from sshd context, unexpected files written around the time of crashes, and privilege-separation sandbox violations. Treat absence of logs as inconclusive on systems without verbose SSH, crash, or network telemetry.
- OpenSSH_9.1
- SSH-2.0-FuTTY
- FuTTY
- sshd.*segmentation fault
- sshd.*Segmentation fault
- sshd.*core dumped
- sshd.*double free
- malloc(): double free
- free(): double free
- free(): double free detected in tcache
- sshd.*malloc
- sshd.*abort
- sshd.*SIGABRT
- sshd.*SIGSEGV
- sshd.*privsep.*abnormal
- systemd-coredump.*sshd
- /var/lib/systemd/coredump/core.sshd
- /var/crash/*sshd*
- /var/log/auth.log
- /var/log/secure
- /var/log/messages
What your security team should do
- Prioritize inventory and remediation of externally reachable SSH services reporting OpenSSH 9.1 or unknown/custom OpenSSH builds because exploit availability and EPSS indicate high scanning interest.
- Patch to OpenSSH 9.2 or a vendor-fixed package immediately; for source builds, include commit 486c4dc3b83b4b67d663fb0fa62bc24138ec3946 or equivalent.
- Validate distribution backports through package changelogs and security advisories, not only through the OpenSSH banner.
- Temporarily restrict SSH access to trusted IP ranges, VPNs, bastion hosts, or management networks until remediation is complete.
- Enable monitoring for sshd crashes, core dumps, abnormal restarts, and unusual volumes of failed or incomplete SSH handshakes.
- Review exposure on nonstandard SSH ports, appliances, containers, embedded systems, jump boxes, CI/CD workers, and backup infrastructure where OpenSSH may be bundled independently.
- Maintain rate limiting and connection throttling for SSH to reduce denial-of-service impact from repeated unauthenticated trigger attempts.
The record
OpenSSH server (sshd) 9.1 introduced a double-free vulnerability during options.kex_algorithms handling. This is fixed in OpenSSH 9.2. The double free can be leveraged, by an unauthenticated remote attacker in the default configuration, to jump to any location in the sshd address space. One third-party report states "remote code execution is theoretically possible."
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| AlmaLinux:9 | openssh | 0 | 8.7p1-29.el9_2 |
| AlmaLinux:9 | openssh-askpass | 0 | 8.7p1-29.el9_2 |
| AlmaLinux:9 | openssh-clients | 0 | 8.7p1-29.el9_2 |
| AlmaLinux:9 | openssh-keycat | 0 | 8.7p1-29.el9_2 |
| AlmaLinux:9 | openssh-server | 0 | 8.7p1-29.el9_2 |
| AlmaLinux:9 | pam_ssh_agent_auth | 0 | 0.10.4-5.29.el9_2 |
| Chainguard | openssh | 0 | 9.2_p1-r0 |
| Chainguard | openssh-client | 0 | 9.2_p1-r0 |
| Chainguard | openssh-doc | 0 | 9.2_p1-r0 |
| Chainguard | openssh-keygen | 0 | 9.2_p1-r0 |
| Chainguard | openssh-keyscan | 0 | 9.2_p1-r0 |
| Chainguard | openssh-keysign | 0 | 9.2_p1-r0 |
| Chainguard | openssh-pam-config | 0 | 9.2_p1-r0 |
| Chainguard | openssh-pam-configuration | 0 | 9.2_p1-r0 |
| Chainguard | openssh-pkcs11-helper | 0 | 9.2_p1-r0 |
| Chainguard | openssh-server | 0 | 9.2_p1-r0 |
| Chainguard | openssh-server-config | 0 | 9.2_p1-r0 |
| Chainguard | openssh-service | 0 | 9.2_p1-r0 |
| Chainguard | openssh-sftp-server | 0 | 9.2_p1-r0 |
| Chainguard | openssh-sk-helper | 0 | 9.2_p1-r0 |
| Debian:12 | openssh | 0 | 1:9.2p1-1 |
| Debian:13 | openssh | 0 | 1:9.2p1-1 |
| Red Hat:enterprise_linux:9::appstream | openssh | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::appstream | openssh-askpass | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::appstream | openssh-askpass-debuginfo | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::appstream | openssh-clients | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::appstream | openssh-clients-debuginfo | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::appstream | openssh-debuginfo | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::appstream | openssh-debugsource | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::appstream | openssh-keycat | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::appstream | openssh-keycat-debuginfo | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::appstream | openssh-server | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::appstream | openssh-server-debuginfo | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::appstream | openssh-sk-dummy-debuginfo | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::appstream | pam_ssh_agent_auth | 0 | 0:0.10.4-5.29.el9_2 |
| Red Hat:enterprise_linux:9::appstream | pam_ssh_agent_auth-debuginfo | 0 | 0:0.10.4-5.29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | openssh | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | openssh-askpass | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | openssh-askpass-debuginfo | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | openssh-clients | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | openssh-clients-debuginfo | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | openssh-debuginfo | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | openssh-debugsource | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | openssh-keycat | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | openssh-keycat-debuginfo | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | openssh-server | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | openssh-server-debuginfo | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | openssh-sk-dummy-debuginfo | 0 | 0:8.7p1-29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | pam_ssh_agent_auth | 0 | 0:0.10.4-5.29.el9_2 |
| Red Hat:enterprise_linux:9::baseos | pam_ssh_agent_auth-debuginfo | 0 | 0:0.10.4-5.29.el9_2 |
| Ubuntu:Pro:FIPS-updates:18.04:LTS | openssh | 0 | No fix |
| Ubuntu:Pro:FIPS-updates:24.04:LTS | openssh | 0 | No fix |
| Ubuntu:Pro:FIPS:18.04:LTS | openssh | 0 | No fix |
| Wolfi | openssh | 0 | 9.2_p1-r0 |
| Wolfi | openssh-client | 0 | 9.2_p1-r0 |
| Wolfi | openssh-doc | 0 | 9.2_p1-r0 |
| Wolfi | openssh-keygen | 0 | 9.2_p1-r0 |
| Wolfi | openssh-keyscan | 0 | 9.2_p1-r0 |
| Wolfi | openssh-keysign | 0 | 9.2_p1-r0 |
| Wolfi | openssh-pam-config | 0 | 9.2_p1-r0 |
| Wolfi | openssh-pam-configuration | 0 | 9.2_p1-r0 |
| Wolfi | openssh-pkcs11-helper | 0 | 9.2_p1-r0 |
| Wolfi | openssh-server | 0 | 9.2_p1-r0 |
| Wolfi | openssh-server-config | 0 | 9.2_p1-r0 |
| Wolfi | openssh-service | 0 | 9.2_p1-r0 |
| Wolfi | openssh-sftp-server | 0 | 9.2_p1-r0 |
| Wolfi | openssh-sk-helper | 0 | 9.2_p1-r0 |
Related vulnerabilities
- CVE-2024-6409 A race condition vulnerability was discovered in how signals are handled by OpenSSH's… Also affects openssh
- CVE-2024-6387 A security regression (CVE-2006-5051) was discovered in OpenSSH's server (sshd). Also affects openssh
- CVE-2023-51385 In ssh in OpenSSH before 9.6, OS command injection might occur if a user name or host… Also affects openssh
- CVE-2023-48795 The SSH transport protocol with certain OpenSSH extensions, found in OpenSSH before 9.6… Also affects openssh
- CVE-2023-51384 In ssh-agent in OpenSSH before 9.6, certain destination constraints can be incompletely… Also affects openssh
- CVE-2023-28531 ssh-add in OpenSSH before 9.3 adds smartcard keys to ssh-agent without the intended… Also affects openssh
- CVE-2021-41617 sshd in OpenSSH 6.2 through 8.x before 8.8, when certain non-default configurations are… Also affects openssh
- CVE-2016-10708 sshd in OpenSSH before 7.4 allows remote attackers to cause a denial of service (NULL… Also affects openssh