CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-39835

CVE-2026-39835: Remote Denial of Service via Null Pointer Dereference in Go SSH CertChecker

Amit Schendel
Amit Schendel
Senior Security Researcher

Jun 26, 2026·7 min read·5 visits

Executive Summary (TL;DR)

An unauthenticated remote attacker can crash Go SSH servers using CertChecker by presenting certificates during the handshake, exploiting uninitialized function pointers.

A Denial of Service (DoS) vulnerability exists in the Go SSH implementation package (golang.org/x/crypto/ssh). The vulnerability is caused by a null pointer dereference (runtime panic) when CertChecker is utilized as a public key callback but its validation fields, IsUserAuthority or IsHostAuthority, are uninitialized.

Vulnerability Overview and Technical Context

The Go programming language provides a standard library subrepository golang.org/x/crypto/ssh for building custom secure shell (SSH) servers and clients. In enterprise ecosystems, custom Go-based SSH endpoints are widely deployed to handle automated tasks, secure file transfer interfaces, developer gateways, and infrastructure control planes. The cryptographic library relies on modular structures and callback functions to delegate authority verification to application-level logic.

One such critical structure is the CertChecker utility, which implements standard SSH certificate validation rules. It contains specific field hooks for validating user authorities and host authorities, namely the IsUserAuthority and IsHostAuthority callback functions. When an incoming client presents a certificate to a server or host validation occurs, the server relies on these hooks to decide whether the signing entity is trusted.

The vulnerability designated as CVE-2026-39835 is a classic null pointer dereference weakness (CWE-476) residing in the core certificate verification routines. Because Go allows partial structure initialization, applications can instantiate CertChecker without defining these function variables, leaving them with default nil values. When a remote, unauthenticated connection attempts to perform certificate authentication, the package dereferences the nil variable, causing an unhandled panic that terminates the entire host program.

Root Cause Analysis and Code Path Execution

To understand the root cause, one must examine the behavior of structure allocation and zero-values in Go. In the ssh package, CertChecker is designed as a modular validator. It defines function fields such as IsUserAuthority which returns a boolean. If an application developer initializes CertChecker as part of an SSH server's public key callback configuration but fails to populate the callback fields, Go sets these pointers to nil.

The library lacks prior defensive validation before invoking these callback functions. During the handshake sequence, when a user presents an SSH certificate, the execution flow is routed into the CertChecker.Authenticate method. This method extracts the signature key of the certificate and immediately attempts to call c.IsUserAuthority(cert.SignatureKey).

In Go, invoking a function variable that contains a nil address initiates an immediate runtime panic. While normal errors are returned as values, a panic is an exceptional control flow event. Because individual SSH connections are executed inside separate, concurrent background goroutines managed by the Go runtime, an unrecovered panic in any single goroutine is not isolated. Instead, it propagates upwards and crashes the entire application process, leading to immediate denial of service.

Code Analysis

The vulnerable implementation inside ssh/certs.go failed to perform guard checks prior to dispatching validation parameters to application-defined function pointers. The functions CheckHostKey and Authenticate directly invoke c.IsHostAuthority and c.IsUserAuthority respectively. Below is a conceptual representation of the vulnerable pathways:

// Vulnerable implementation in ssh/certs.go
func (c *CertChecker) CheckHostKey(addr string, remote net.Addr, key PublicKey) error {
    // ... cert type validation checks ...
    // The following call is executed without a nil safety guard
    if !c.IsHostAuthority(cert.SignatureKey, addr) {
        return fmt.Errorf("ssh: no authorities for hostname: %v", addr)
    }
    // ... rest of validation ...
}

The following patch introduces structural safety guards within ssh/certs.go under CL 781660. The modification checks the validity of the function pointers before execution and returns standard error objects:

// Patched implementation in ssh/certs.go
if cert.CertType != HostCert {
    return fmt.Errorf("ssh: certificate presented as a host key has type %d", cert.CertType)
}
// Explicit safety check added to prevent null pointer dereference
if c.IsHostAuthority == nil {
    return errors.New("ssh: cannot verify certificate, IsHostAuthority not set")
}
if !c.IsHostAuthority(cert.SignatureKey, addr) {
    return fmt.Errorf("ssh: no authorities for hostname: %v", addr)
}

A parallel guard block was introduced within CertChecker.Authenticate to secure the IsUserAuthority callback. These checks successfully transform an unhandled runtime crash vector into a manageable, loggable error state. The patch is considered highly complete as it thoroughly resolves both vulnerable execution pathways inside the package.

Exploitation Methodology

Exploitation of CVE-2026-39835 requires minimal sophistication and can be initiated by a remote, unauthenticated attacker. The target server must be configured to use CertChecker within its SSH server configuration, and the fields must be left uninitialized. This scenario occurs when developers assume that leaving fields blank acts as a default rejection rather than an unhandled code path.

An attacker begins by establishing a raw TCP connection to the exposed SSH listener port of the target. Once the TCP socket is open, the client sends an SSH identification string to negotiate the protocol version. After completing the initial key exchange, the client transitions to the user authentication phase by sending an SSH_MSG_USERAUTH_REQUEST message specifying public key authentication.

Instead of offering a traditional RSA or Ed25519 public key, the attacker offers an SSH certificate. When the server processes this certificate, it delegates verification to CertChecker.Authenticate. The Go runtime immediately attempts to execute the nil pointer, generating a fatal panic on the server console and terminating the process. No state changes, file writes, or memory corruption occur; the attack is purely focused on service disruption.

Impact Assessment and Downstream Exposure

The severity of CVE-2026-39835 is classified as Medium, with a CVSS v3.1 base score of 5.3. The impact is limited strictly to system availability, with no risk of confidentiality breach or unauthorized modifications. However, in modern cloud-native environments, the actual operational impact can be severe depending on application monitoring and restart configurations.

Because many critical operations rely on Go-based infrastructure utilities like HashiCorp Vault, Docker registries, or Gitea code servers, crashing the service disrupts dependent continuous integration and deployment pipelines. If the target application lacks a reliable container orchestrator or process supervisor to restart the crashed binary, the denial of service remains permanent until manual administrator intervention.

Even if an automated system restarts the service, repeated exploitation attempts can generate a continuous loop of process restarts. This continuous loop degrades hardware performance, floods log streams with unhandled core dumps, and prevents legitimate connections. The ease of remote execution makes it a high-priority target for automated denial of service scripts.

Detection and Remediation

The primary and recommended solution is to upgrade the golang.org/x/crypto package to version v0.52.0 or higher. Developers can execute the standard dependency update commands to pull the latest version of the subrepository. This update integrates the safety verification guards into the application compilation tree automatically.

In environments where upgrading the library is not immediately possible, application-level workarounds can prevent the panic. Developers must audit their SSH configurations to guarantee that CertChecker instances never contain nil fields. Even if certificate verification is not supported, the fields should be explicitly defined with safe fallback functions that reject all inputs.

// Application-level safety workaround
checker := &ssh.CertChecker{
    IsUserAuthority: func(auth ssh.PublicKey) bool {
        return false
    },
    IsHostAuthority: func(auth ssh.PublicKey, address string) bool {
        return false
    },
}

Additionally, integration of automated detection tooling such as govulncheck helps security teams locate vulnerable references during compilation or automated continuous integration builds. Network-level controls, such as rate limiting and IP access lists, should be deployed to restrict SSH port exposure to trusted actors.

Official Patches

GoGerrit Change CL 781660

Technical Appendix

CVSS Score
5.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
EPSS Probability
0.21%
Top 89% most exploited

Affected Systems

Docker / MobyHashiCorp VaultPrometheusGiteacontainerdPodmanTrivyAmazon CloudWatch AgentAWS Systems Manager Agent (SSM)SOPSAtlantisCloudflaredSplunk OpenTelemetry Collector

Affected Versions Detail

Product
Affected Versions
Fixed Version
golang.org/x/crypto
Go
< 0.52.00.52.0
AttributeDetail
CWE IDCWE-476
Attack VectorNetwork
CVSS Severity5.3 (Medium)
Exploit StatusProof of Concept
Affected Packagegolang.org/x/crypto/ssh
Fixed Versionv0.52.0

MITRE ATT&CK Mapping

T1499.003Endpoint Denial of Service: Application Denial of Service
Impact
CWE-476
NULL Pointer Dereference

The application attempts to dereference a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.

Vulnerability Timeline

Security patch authored and submitted to Gerrit
2026-01-25
Private issue tracking completed under case b/503003289
2026-05-21
Public announcement and CVE disclosure
2026-05-22

References & Sources

  • [1]Go Issue 79563
  • [2]Go Announce Mailing List
  • [3]Go VulnDB Entry GO-2026-5015

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2026-39828
6.3

CVE-2026-39828: Go SSH Server PartialSuccessError Permissions Discard Bypass

A critical security bypass vulnerability was discovered in the Go SSH server implementation within the golang.org/x/crypto/ssh package. When an SSH server authentication callback returned a PartialSuccessError alongside non-nil Permissions, the server silently discarded these permissions before the subsequent authentication step. Consequently, once the user completed the second-factor authentication, the session-level restrictions were dropped, granting the client unauthorized capabilities.

Amit Schendel
Amit Schendel
3 views•7 min read
•about 2 hours ago•CVE-2026-39827
6.5

CVE-2026-39827: Denial of Service via Unbounded Memory Growth in Go SSH (golang.org/x/crypto/ssh)

An unbounded memory leak vulnerability in the Go SSH package (golang.org/x/crypto/ssh) allows authenticated users to crash the server by repeatedly requesting connection channels that are rejected, leading to system resource exhaustion.

Amit Schendel
Amit Schendel
4 views•6 min read
•about 3 hours ago•CVE-2026-39830
9.1

CVE-2026-39830: Unsolicited Response Channel Deadlock and Resource Leak in golang.org/x/crypto/ssh

A denial-of-service (DoS) and resource leak vulnerability in the Go SSH package (golang.org/x/crypto/ssh) allows a malicious peer to permanently deadlock connection processing loops and leak memory. This issue stems from improper handling of unsolicited responses at the global and channel layers, which saturate internal bounded channel buffers and block the main multiplexer loop. The vulnerability is fully resolved in version 0.52.0.

Alon Barad
Alon Barad
4 views•7 min read
•about 5 hours ago•CVE-2026-39829
7.5

CVE-2026-39829: Denial of Service in Go SSH Parser

A high-severity Denial of Service (DoS) vulnerability exists in the golang.org/x/crypto/ssh package prior to version 0.52.0. The vulnerability is caused by a lack of size and range validation on incoming RSA and DSA public key parameters during SSH authentication. An unauthenticated attacker can submit a crafted public key with pathologically large parameters, triggering intensive CPU computation during signature verification and leading to a complete Denial of Service.

Alon Barad
Alon Barad
5 views•5 min read
•about 7 hours ago•CVE-2026-39831
9.1

CVE-2026-39831: Authentication Bypass in golang.org/x/crypto/ssh via FIDO/U2F User Presence Bypass

An authentication bypass vulnerability was identified in the golang.org/x/crypto/ssh package. The library's verification logic for FIDO/U2F security keys failed to check the User Presence (UP) flag. This omission allows an attacker with access to a hardware token interface or an agent-forwarding socket to authenticate without physical user interaction.

Alon Barad
Alon Barad
6 views•5 min read
•about 8 hours ago•CVE-2026-39834
9.1

CVE-2026-39834: Infinite Loop and CPU Exhaustion via Integer Truncation in Go SSH Channel Write

A critical vulnerability exists in the Go SSH sub-repository (golang.org/x/crypto/ssh) before version 0.52.0. When an application writes payloads of 4GB or larger in a single write operation, integer truncation in the remote window calculation causes an infinite loop. This results in complete CPU core exhaustion and a denial-of-service condition.

Amit Schendel
Amit Schendel
8 views•7 min read