OpenSSH Vulnerability CVE-2026-3497 Puts Systems at Risk of Remote Exploitation and Privilege Bypass

Critical OpenSSH GSSAPI Vulnerability Exposes Systems to Remote Attacks

A significant security flaw has been identified in the Generic Security Service Application Program Interface (GSSAPI) Key Exchange implementation within OpenSSH, a widely used suite for secure network communications. This vulnerability, designated as CVE-2026-3497, was discovered by security researcher Jeremy Brown and poses a substantial risk to systems utilizing affected versions of OpenSSH.

Understanding the Vulnerability

The root of this vulnerability lies in a coding error within the `kexgsss.c` file, which handles the server-side GSSAPI key exchange process. Specifically, the function `sshpkt_disconnect()` was incorrectly used in place of `ssh_packet_disconnect()` within the default error-handling routine. Unlike `ssh_packet_disconnect()`, which terminates the process upon encountering an error, `sshpkt_disconnect()` merely queues a disconnect message and allows the process to continue running.

This oversight leads to the execution of code that reads an uninitialized stack variable named `recv_tok`. The contents of this variable are subsequently sent to the privileged monitor process via inter-process communication (IPC) and passed to the `gss_release_buffer()` function. This sequence can result in the `free()` function being called on an uninitialized pointer, leading to confirmed heap corruption.

Potential Impact

The implications of this vulnerability are severe:

– Remote Exploitation: An attacker can exploit this flaw by sending a single crafted SSH packet of approximately 300 bytes, without the need for authentication credentials.

– Process Crashes: On x86_64 systems, successful exploitation can cause the SSH child process to crash, resulting in signals such as SIGABRT (signal 6) or SIGSEGV (signal 11).

– Privilege Separation Violation: The flaw allows up to 127KB of heap data to be transmitted to the root-level monitor process through the privsep IPC channel, effectively breaching privilege separation boundaries.

The severity of the impact varies across different Linux distributions due to variations in compiler options and optimization flags. For instance, systems compiled with Clang using the `-O0` flag may leave a pointer value of `0xfffbe600` with a length of 4 bytes, whereas those compiled with GCC using `-O2 -fno-stack-protector` may leave a valid heap address with a length of 127,344 bytes.

Affected Systems

Systems running OpenSSH servers with the `GSSAPIKeyExchange` option enabled are at risk. Notably, Ubuntu and Debian distributions have been confirmed to be potentially affected. However, due to the widespread adoption of the GSSAPI Key Exchange patch across various Linux distributions, the scope of impact is likely broader.

Mitigation and Remediation

To address this critical vulnerability, the following steps are recommended:

1. Apply Patches: Administrators should promptly apply the patches provided by their respective Linux distributions. For example, Ubuntu has already released a patch that rectifies this issue.

2. Modify Configuration: As a temporary measure, disabling the `GSSAPIKeyExchange` option in the SSH server configuration can mitigate the risk. This can be achieved by setting `GSSAPIKeyExchange no` in the SSH daemon configuration file.

3. Code Correction: For those managing custom builds, replacing all instances of `sshpkt_disconnect()` with `ssh_packet_disconnect()` within the `kexgsss.c` file effectively resolves the issue.

Conclusion

The discovery of CVE-2026-3497 underscores the critical importance of rigorous code review and prompt patch management in maintaining the security of network services. Administrators are urged to assess their systems for exposure to this vulnerability and implement the recommended mitigations without delay to safeguard against potential exploits.