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-39834

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

Amit Schendel
Amit Schendel
Senior Security Researcher

Jun 26, 2026·7 min read·4 visits

Executive Summary (TL;DR)

Writing payloads larger than 4GB to a Go SSH channel causes integer truncation, leading to an infinite write loop and 100% CPU utilization on the executing thread.

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.

Vulnerability Overview

The Go SSH sub-repository, distributed as part of golang.org/x/crypto/ssh, is widely used across the Go ecosystem to implement SSH clients, servers, and tunnels. A denial-of-service vulnerability, tracked as CVE-2026-39834 and GO-2026-5020, resides in the channel data transfer logic. The vulnerability occurs when transferring exceptionally large datasets over an established SSH channel.

The specific issue belongs to the class of integer overflow and truncation errors, cataloged as CWE-190. It manifests when an application calls write operations, such as Write or WriteExtended, with a payload slice size that exceeds the maximum bounds of a 32-bit unsigned integer (4 GiB, or 4,294,967,296 bytes). The vulnerability does not require authentication privileges if the application exposes a file upload or streaming endpoint that forwards user data into an SSH channel.

Upon encountering a 4 GiB write boundary, the internal packet-chunking logic truncates the calculated size of the next data packet to zero. Because the state machine receives a packet size of zero, it makes no progress through the data stream but continues to execute the write loop. The resulting execution loop runs indefinitely, pinning the affected CPU core to 100% capacity and degrading the performance or availability of the entire system.

Root Cause Analysis

The technical root cause of the vulnerability lies in the packet size calculation within ssh/channel.go. In the SSH protocol, large payloads are split into smaller chunks bounded by the remote party's maximum payload size and the available window space. This process is managed by an internal helper function called min in vulnerable versions.

The min function is defined with the signature func min(a uint32, b int) uint32. The first parameter a represents ch.maxRemotePayload, which is typically a uint32 variable. The second parameter b is the length of the remaining data slice (len(data)), which is of type int.

On 64-bit architectures, the Go native int type is a 64-bit signed integer. When a caller attempts to transmit a payload size of exactly $2^{32}$ bytes (4 GiB), b holds the value 4,294,967,296. The binary representation of this value is 0x100000000. When the code evaluates uint32(b), the cast drops the upper 32 bits of the 64-bit integer, resulting in a truncated value of 0.

Inside the comparison block, if a < uint32(b) compares the maximum payload size (for example, 32768) to the truncated value of 0. Because 32768 < 0 is false, the function executes the fallback branch and returns uint32(b), which is 0. Consequently, the allocation engine attempts to reserve zero bytes of window capacity and sends an empty packet. Since zero bytes are subtracted from the total remaining length of the payload, the write loop repeats indefinitely with the exact same variables, consuming 100% CPU.

Code Analysis and Patch Walkthrough

To resolve the truncation defect, the Go security team implemented a fix in Change List 781663. The primary fix changes the comparison logic within ssh/channel.go to use 64-bit integer values, preventing truncation during the comparison phase. Additionally, the function was renamed to avoid namespace conflicts with Go's native built-in min function introduced in modern Go releases.

Below is the comparison of the vulnerable logic and the corrected implementation:

// VULNERABLE FUNCTION
func min(a uint32, b int) uint32 {
	if a < uint32(b) {
		return a
	}
	return uint32(b)
}
 
// PATCHED FUNCTION
// minPayloadSize returns min(limit, length) clamped to a uint32.
// The comparison is done in int64 because length is an int — on
// 64-bit systems len(data) can exceed 2^32, and a direct uint32(length)
// cast would silently truncate to 0 at every multiple of 2^32.
func minPayloadSize(limit uint32, length int) uint32 {
	if int64(length) > int64(limit) {
		return limit
	}
	return uint32(length)
}

The corrected implementation casts both variables to int64 before conducting the comparison. Because int64 is capable of representing values up to $2^{63}-1$, the value of length (even when exceeding 4 GiB) is accurately preserved. If the remaining data size length is greater than the limit, the function safely returns the limit (which is already a uint32). If the remaining data size is smaller than the limit, it is guaranteed to fit within a uint32 variable, making the conversion safe from truncation.

Exploitation Methodology

Exploitation of CVE-2026-39834 requires the attacker to interact with an application that exposes an interface capable of sending data to an SSH channel. The host can be either an SSH client or an SSH server, meaning both outbound and inbound data flows are potentially vulnerable.

To trigger the denial-of-service condition, an attacker must cause the application to execute a single write call of size $n$, where $n$ is an exact multiple of 4 GiB, or slightly above 4 GiB such that the truncated value of b is smaller than the remote window payload threshold.

The vulnerability is triggered at the network boundaries. When the application receives the payload and passes it to the golang.org/x/crypto/ssh channel writer, the executing goroutine becomes stuck. No network errors or panics are thrown; the code simply spins, generating high CPU load. Since Go utilizes cooperative and pre-emptive scheduling, a single spinning goroutine will lock a complete OS thread, eventually degrading the availability of other application routines.

Impact Assessment and Affected Ecosystems

The impact of CVE-2026-39834 is classified as a high-severity Denial of Service (DoS). By utilizing relatively minor local resources to initiate a large file stream or data transfer, an attacker can consume all available CPU cycles on the target system. This causes complete resource exhaustion and halts other system operations.

The CVSS v3.1 score is evaluated at 9.1, reflecting the high availability impact and ease of execution over a network. Since the Go SSH package is the fundamental library for several high-profile infrastructure applications, the downstream impact is wide.

Affected downstream products include popular orchestrators, container engines, and cloud agents. Programs like Docker, containerd, HashiCorp Vault, Prometheus, and various cloud log-collection daemons are affected if they negotiate raw data channels via SSH with untrusted endpoints. In multi-tenant environments, a single user running an exploit against an SSH-based service could cause a complete service disruption for all other tenants sharing the same physical host.

Remediation and Detection

The definitive remediation for this vulnerability is to upgrade the golang.org/x/crypto dependency to version v0.52.0 or higher. This update introduces the fixed minPayloadSize logic, which natively handles sizes larger than 4 GiB without truncation.

For systems where immediate upgrades are not possible, defensive mitigations can be applied at the application layer. Implementing application-level chunking ensures that no single call to channel.Write() exceeds a safe limit, such as 1 GiB.

// Application-level safety wrapper
func SafeChannelWrite(ch ssh.Channel, data []byte) (int, error) {
	const maxChunkSize = 1024 * 1024 * 1024 // 1 GiB
	total := 0
	for len(data) > 0 {
		chunk := len(data)
		if chunk > maxChunkSize {
			chunk = maxChunkSize
		}
		n, err := ch.Write(data[:chunk])
		total += n
		if err != nil {
			return total, err
		}
		data = data[n:]
	}
	return total, nil
}

Additionally, system administrators should monitor for anomalous Go processes running at 100% CPU capacity with minimal network output. Static code analysis pipelines should be configured to run dependency check tools to identify packages importing vulnerable versions of the SSH library.

Fix Analysis (1)

Technical Appendix

CVSS Score
9.1/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
EPSS Probability
0.47%
Top 63% most exploited

Affected Systems

Docker / Moby / containerd / Docker ComposeHashiCorp Vault / PackerPrometheus / ThanosTrivy / Kubescape CLI / gptscriptGitea / SOPS / AtlantisMinIO / RcloneAmazon CloudWatch Agent / AWS Systems Manager Agent (SSM)Splunk OpenTelemetry Collector

Affected Versions Detail

Product
Affected Versions
Fixed Version
golang.org/x/crypto
Go Cryptography
< 0.52.00.52.0
AttributeDetail
CWE IDCWE-190
Attack VectorNetwork
CVSS v3.1 Score9.1 (Critical)
EPSS Score0.00466
ImpactDenial of Service (DoS) via 100% CPU exhaustion
Exploit Statusnone
KEV StatusNot listed

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
T1498Network Service Abuse
Impact
CWE-190
Integer Overflow or Wraparound

The software performs a calculation that can produce an integer overflow or wraparound, causing the logic to evaluate incorrectly or behave unpredictably.

Vulnerability Timeline

Vulnerability identified during audit by NCC Group Cryptography Services, sponsored by Teleport.
2025-12-14
Go private issue tracking initialized as Google internal tracking b/502989042 and Go Issue 79567.
2026-05-21
Patch CL 781663 uploaded to Go Review.
2026-05-21
Gerrit CL 781663 merged, security advisory published, and CVE-2026-39834 released.
2026-05-22

References & Sources

  • [1]Go Change List (Gerrit)
  • [2]Go Issue Tracker Thread
  • [3]Go Announcement Mailing List
  • [4]Go Vulnerability Database Entry
  • [5]JSON Vuln Database Schema
  • [6]CVE.org Official Record
  • [7]Wiz Vulnerability Database Analysis

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-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
3 views•5 min read
•about 4 hours ago•CVE-2026-42508
9.1

CVE-2026-42508: Bypass of SSH Certificate Authority Revocation in golang.org/x/crypto/ssh/knownhosts

An issue was discovered in Go's `golang.org/x/crypto/ssh/knownhosts` package where a revoked Certification Authority (CA) public key was not correctly checked for revocation during SSH host certificate validation. This allowed clients or servers utilizing the library to validate and trust host certificates issued by explicitly revoked CAs.

Alon Barad
Alon Barad
8 views•5 min read
•about 5 hours ago•CVE-2026-46595
10.0

CVE-2026-46595: Critical Authorization Bypass via source-address Validation Failure in golang.org/x/crypto/ssh

An authorization bypass vulnerability exists in the golang.org/x/crypto/ssh package prior to version 0.52.0. When an SSH server is configured with a custom VerifiedPublicKeyCallback that returns a Permissions object containing a source-address critical option, the server fails to validate and enforce the restriction. This allows remote clients with valid public keys to bypass IP-based access restrictions and authenticate from unauthorized network locations.

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

CVE-2026-48517: Remote Code Execution via Typeless Deserialization Blocklist Bypass in MessagePack-CSharp

A critical vulnerability exists in MessagePack-CSharp's typeless deserialization mechanism where configured blocklists fail to recursively inspect nested types. An attacker can bypass security restrictions by wrapping unauthorized types in arrays or generic collections, allowing insecure deserialization and remote code execution.

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

CVE-2026-48713: Remote Prototype Pollution in i18next-fs-backend

A critical prototype pollution vulnerability exists in the i18next-fs-backend Node.js package (prior to version 2.6.6) through its translation persistence layer. When handling missing translation keys, insecure traversal of JSON objects via the getLastOfPath function allows remote, unauthenticated attackers to mutate Object.prototype, potentially leading to denial of service, security bypasses, or remote code execution.

Alon Barad
Alon Barad
5 views•7 min read
•1 day ago•CVE-2026-48708
7.5

CVE-2026-48708: Concurrent Template Parsing Race Condition in OliveTin leading to Cross-Request Command Contamination

CVE-2026-48708 details a critical concurrency synchronization flaw in OliveTin versions < 3000.13.0. A shared package-level text/template.Template instance is accessed concurrently across multiple goroutines without proper synchronization. When concurrent request processing occurs, a race condition causes Go runtime panics or command contamination across separate sessions, enabling denial of service or execution of contaminated commands.

Amit Schendel
Amit Schendel
7 views•6 min read