Summary
A critical stream desynchronization vulnerability has been identified in the AMQP wire-protocol parser. When parsing a long string (readLongstr) within a table field, providing a length that exceeds the maximum signed 32-bit integer (2^31 - 1, or roughly 2.1 GiB) triggers an improper error-handling condition. The parser abruptly aborts the read and returns a success status ("",nil) without consuming the specified bytes from the underlying network buffer. This causes all subsequent read operations to become misaligned. The parser interprets arbitrary offsets within the remaining payload bytes as valid AMQP frame headers, leading to potential Remote Code Execution (RCE), data injection, or complete connection hijacking.
Vulnerability Details
The vulnerability exists within the bounds-checking logic of the readLongstr function:
// read.go:113-114 — silent no-op return, bytes left in stream
if length > (^uint32(0) >> 1) {
return // returns "", nil, does NOT consume `length` bytes
}
When length evaluates to a value greater than 0x7FFFFFFF:
return statement."", nil (indicating a successful read of an empty string).length bytes. The malformed payload remains sitting in the TCP/buffer stream.Impact
As readTable continues iterating over the stream under the assumption that the string was successfully parsed, the byte alignment is entirely broken.
connection.close, channel.open, or message publishing frames), forcing the client/server to execute unintended actions.{
"cwe_ids": [
"CWE-754"
],
"github_reviewed": true,
"github_reviewed_at": "2026-09-17T17:04:25Z",
"nvd_published_at": "2026-09-16T15:17:50Z",
"severity": "CRITICAL"
}