CVE-2026-77406 Overview
CVE-2026-77406 is an integer truncation vulnerability [CWE-195] in the RabbitMQ amqp091-go client, a Go implementation of the AMQP 0.9.1 protocol. Versions prior to 1.13.0 accept negative prefetchCount and prefetchSize values in the Channel.Qos function and cast them directly to uint16 and uint32 without validation. A value of -1 wraps to 65535 or 4294967295, causing the broker to deliver extremely large volumes of queued messages. Applications that allow untrusted configuration of Qos values can exhaust client memory and disrupt message processing.
Critical Impact
A remote broker or attacker-controlled configuration input can trigger client-side memory exhaustion, causing denial of service in Go applications that consume from AMQP queues.
Affected Products
- RabbitMQ amqp091-go client library, all versions prior to 1.13.0
- Go applications embedding github.com/rabbitmq/amqp091-go as an AMQP consumer
- Services accepting untrusted configuration for prefetchCount or prefetchSize
Discovery Timeline
- 2026-09-16 - CVE-2026-77406 published to NVD
- 2026-09-16 - Last updated in NVD database
Technical Details for CVE-2026-77406
Vulnerability Analysis
The flaw resides in channel.go within the Channel.Qos method of the amqp091-go client. The function signature accepts signed int parameters for prefetchCount and prefetchSize, then casts them to the AMQP wire types uint16 and uint32 for the basic.qos frame. Prior to version 1.13.0, no validateQos routine existed to reject negative values.
When a negative integer is cast to an unsigned type in Go, two's complement wrap-around occurs. A prefetchCount of -1 becomes 65535, and a prefetchSize of -1 becomes 4294967295. The broker interprets these as legitimate consumer limits and dispatches messages accordingly.
Root Cause
The root cause is missing input validation combined with an unsafe numeric type conversion. The public API exposes signed integers for developer convenience but does not enforce the protocol's unsigned range constraints. This mismatch allows negative values to silently transform into the maximum possible prefetch limits.
Attack Vector
Exploitation requires an application that forwards untrusted input into the Channel.Qos call. Configuration files, environment variables, HTTP admin endpoints, or multi-tenant control planes are typical injection points. Once the inflated prefetch is set, the broker floods the client with queued messages until the process runs out of memory.
// Security patch in channel.go - Reject negative prefetch values in Qos (#351)
// http://www.rabbitmq.com/blog/2012/04/25/rabbitmq-performance-measurements-part-2/
func (ch *Channel) Qos(prefetchCount, prefetchSize int, global bool) error {
// TODO: Change prefetchCount and prefetchSize types from int to uint16 and uint32 respectively.
// This will be a breaking change and should be done in a future major release.
if err := ch.validateQos(prefetchCount, prefetchSize); err != nil {
return err
}
return ch.call(
&basicQos{
PrefetchCount: uint16(prefetchCount),
// ...
},
)
}
Source: GitHub Commit 3b879e1d
Detection Methods for CVE-2026-77406
Indicators of Compromise
- AMQP consumer processes terminating with out-of-memory errors shortly after startup or reconfiguration
- Broker metrics showing anomalously large prefetch_count values (near 65535) on newly opened channels
- Sudden spikes in unacknowledged message counts on queues consumed by Go services
Detection Strategies
- Perform static analysis (for example, govulncheck) across Go modules to flag github.com/rabbitmq/amqp091-go at versions below 1.13.0
- Instrument application code paths that pass user-controlled values into Channel.Qos and log the effective prefetch parameters
- Correlate broker-side channel telemetry with client memory metrics to identify wrap-around symptoms
Monitoring Recommendations
- Alert on Go process RSS growth exceeding baseline thresholds during AMQP consumer activity
- Monitor RabbitMQ management API channels endpoint for prefetch_count values equal to 65535 combined with high messages_unacknowledged counts
- Track dependency inventories in CI/CD pipelines to detect vulnerable versions of amqp091-go reintroduced by transitive updates
How to Mitigate CVE-2026-77406
Immediate Actions Required
- Upgrade github.com/rabbitmq/amqp091-go to version 1.13.0 or later in all Go services
- Audit application code for Channel.Qos invocations that consume external configuration and reject negative values before the call
- Constrain broker-side consumer limits where supported to bound worst-case memory usage per channel
Patch Information
The fix is included in amqp091-go v1.13.0 and introduces a validateQos check that rejects negative prefetchCount and prefetchSize values before the basic.qos frame is sent. See the GitHub Security Advisory GHSA-rm6m-hrcw-jw33 and Pull Request #351 for full details.
Workarounds
- Validate all Qos parameters at the application layer, rejecting any value less than zero or greater than the AMQP protocol maximum
- Treat configuration inputs for prefetch parameters as untrusted and normalize them to safe defaults such as 100
- Isolate AMQP consumer processes with cgroup memory limits to contain the blast radius if exploitation occurs
# Configuration example: pin the fixed version in go.mod
go get github.com/rabbitmq/amqp091-go@v1.13.0
go mod tidy
# Verify no vulnerable versions remain
go list -m all | grep amqp091-go
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

