Skip to main content
Vulnerability Database/CVE-2026-107386

CVE-2026-107386: amqp091-go Memory Exhaustion Vulnerability

CVE-2026-107386 is a denial of service vulnerability in amqp091-go allowing memory exhaustion attacks before authentication. This post covers technical details, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-107386 Overview

CVE-2026-107386 is a resource exhaustion vulnerability [CWE-770] in the amqp091-go library, a Go client for Advanced Message Queuing Protocol (AMQP) version 0.9.1. The flaw affects versions 1.13.0 through 1.13.x and allows a malicious or compromised AMQP peer to force attacker-controlled memory allocations before the connection handshake completes. The root cause lies in Connection.maxFrameSize using zero to represent both the pre-negotiation and negotiated-unlimited states, which bypasses the prior frame-size allocation mitigation. The issue is fixed in version 1.14.0.

Critical Impact

An unauthenticated remote peer can trigger large memory allocations through a short body-frame header with an inflated declared payload length, causing out-of-memory termination of the client process.

Affected Products

  • rabbitmq/amqp091-go version 1.13.0
  • rabbitmq/amqp091-go versions after 1.13.0 and before 1.14.0
  • Any Go application embedding the vulnerable amqp091-go client

Discovery Timeline

  • 2026-10-08 - CVE-2026-107386 published to the National Vulnerability Database (NVD)
  • 2026-10-09 - Last updated in NVD database

Technical Details for CVE-2026-107386

Vulnerability Analysis

The vulnerability resides in the AMQP frame parsing path exposed through the public Open function. The amqp091-go library parses incoming frames using ReadFrame, which trusts the declared payload length encoded in the body-frame header. An attacker-controlled peer transmits a short header that declares a very large payload length, and the parser allocates a buffer sized to that declared length before verifying the frame against protocol state or receiving the payload bytes.

The prior allocation mitigation relied on Connection.maxFrameSize to cap allocations. However, maxFrameSize encodes two distinct states with the same zero value: not-yet-negotiated and negotiated-unlimited. During the window between TCP connection acceptance and completion of connection.tune, the cap is effectively absent. The condition is reachable even when callers set Config.FrameSize to the AMQP protocol minimum, because the client-side configuration does not populate the atomic ceiling used by the parser.

Root Cause

The root cause is missing bounds enforcement during the pre-negotiation handshake window. Connection.maxFrameSize is initialized to zero and only populated after connection.tune completes, so the body-frame parser accepts the attacker's declared length without an upper limit.

Attack Vector

An attacker who controls or compromises an AMQP peer that the Go client connects to can send a crafted body-frame header immediately after the TCP handshake and before authentication. No credentials are required because the memory allocation occurs before connection.start-ok or connection.tune complete. The result is severe memory pressure, process termination by the operating system out-of-memory killer, or loss of the client process.

go
// Security patch in connection.go - enforces frame size in pre-negotiation state
		errors:                make(chan *Error, 1),
		close:                 make(chan struct{}),
		deadlines:             make(chan readDeadliner, 1),
-		Config:                config,
-		lifeCycle:             newLifeCycle(),
+		// TODO: Connection has Config and also an atomic int for MaxFrameSize. Duplication to simplify.
+		Config:    config,
+		lifeCycle: newLifeCycle(),
	}
+	// Before max frame size is negotiated in Tune, the spec sets a ceiling of 4096 bytes
+	c.maxFrameSize.Store(frameMinSize)
	go c.reader(conn)
	err := c.open(config)
	if err == nil {

Source: GitHub Commit 6723e8c. The patch stores frameMinSize (4096 bytes, the AMQP protocol minimum) into the atomic maxFrameSize before the reader goroutine starts, ensuring the body-frame parser enforces a ceiling during the handshake window.

Detection Methods for CVE-2026-107386

Indicators of Compromise

  • Unexpected spikes in resident memory of Go processes that embed the amqp091-go client, correlated with new inbound AMQP connections.
  • Process termination by the Linux out-of-memory killer referencing a Go binary that uses amqp091-go.
  • AMQP connections to unexpected or untrusted broker endpoints originating from client workloads.

Detection Strategies

  • Inventory Go binaries and dependency manifests (go.mod, go.sum) for github.com/rabbitmq/amqp091-go at versions >=1.13.0, <1.14.0.
  • Use software composition analysis (SCA) tools to flag vulnerable module versions in CI pipelines and container images.
  • Monitor runtime memory allocation anomalies on hosts running AMQP client workloads and alert on rapid growth preceding process restarts.

Monitoring Recommendations

  • Collect per-process memory metrics (RSS, heap in-use) from AMQP client hosts and alert on sudden jumps that correlate with connection events.
  • Log AMQP peer endpoints and TLS certificate details for every outbound connection, enabling detection of connections to unapproved brokers.
  • Forward kernel OOM-killer events and container restart events to a centralized log store for correlation with AMQP client activity.

How to Mitigate CVE-2026-107386

Immediate Actions Required

  • Upgrade github.com/rabbitmq/amqp091-go to version 1.14.0 in all Go projects and rebuild affected binaries and container images.
  • Restrict outbound AMQP connections to known, trusted brokers using egress firewall rules or service-mesh policies.
  • Enforce TLS with certificate pinning or mutual TLS between AMQP clients and brokers to reduce exposure to malicious or spoofed peers.

Patch Information

The fix is included in amqp091-go release v1.14.0. The remediation is implemented in Pull Request #377 and tracked in GHSA-w6r9-248c-frg8. The patch initializes maxFrameSize to frameMinSize (4096 bytes) before the connection reader goroutine starts, ensuring the body-frame parser enforces the AMQP protocol minimum during the pre-negotiation window.

Workarounds

  • No application-level configuration workaround exists, because Config.FrameSize does not populate the atomic ceiling used by the parser in affected versions.
  • Limit AMQP client exposure to untrusted networks and brokers until the upgrade to 1.14.0 is deployed.
  • Apply process-level memory limits (for example, cgroups memory limits or container memory caps) to constrain blast radius while patches are rolled out.
bash
# Upgrade the amqp091-go dependency to the patched release
go get github.com/rabbitmq/amqp091-go@v1.14.0
go mod tidy

# Verify the resolved version
go list -m github.com/rabbitmq/amqp091-go

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.