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

CVE-2026-106122: RabbitMQ Java Client DOS Vulnerability

CVE-2026-106122 is a denial of service flaw in RabbitMQ Java client library that allows attackers to crash consumers through malformed UTF-8 messages. This post explains its impact, affected versions, and mitigation steps.

Published:

CVE-2026-106122 Overview

CVE-2026-106122 affects the RabbitMQ Java client library, which allows Java and JVM-based applications to connect to and interact with RabbitMQ nodes. Versions prior to 5.36.0 contain a flaw in ValueReader.readShortstr that decodes malformed UTF-8 bytes into replacement characters. These characters can re-encode beyond the AMQP shortstr limit enforced by ValueWriter.writeShortstr. An attacker who submits an RPC message with a malformed echoed property can cause reply publication in RpcServer.mainloop() or tutorial-style consumers to throw an unchecked exception before acknowledgement. The broker then requeues the message, enabling a persistent denial-of-service against replacement consumers until the queue is purged. The issue is fixed in version 5.36.0 and tracked under [CWE-172: Encoding Error].

Critical Impact

A single malformed message can disable RPC consumers indefinitely by exploiting broker requeue behavior, causing a sustained denial of service on affected RabbitMQ Java client applications.

Affected Products

  • RabbitMQ Java client library versions prior to 5.36.0
  • Applications using RpcServer.mainloop() with the vulnerable client
  • Tutorial-style consumers built on the affected client versions

Discovery Timeline

  • 2026-10-06 - CVE-2026-106122 published to NVD
  • 2026-10-06 - Last updated in NVD database

Technical Details for CVE-2026-106122

Vulnerability Analysis

The vulnerability resides in how the RabbitMQ Java client parses AMQP shortstr fields. ValueReader.readShortstr decodes incoming byte sequences into Java strings. When the input contains malformed UTF-8, Java substitutes the Unicode replacement character (U+FFFD) during decoding.

The replacement character occupies three bytes when re-encoded as UTF-8. A shortstr value that was 255 bytes on the wire can expand past the 255-byte shortstr ceiling after substitution. When the server tries to echo the property back using ValueWriter.writeShortstr, the length check fails and an unchecked exception propagates.

Because the exception fires inside RpcServer.mainloop() before the consumer acknowledges the message, the broker treats the delivery as unprocessed. The message is requeued and redelivered, trapping any replacement consumer in the same failure loop.

Root Cause

The root cause is an improper encoding/decoding symmetry violation [CWE-172]. ValueReader accepts byte sequences up to 255 bytes without validating UTF-8 correctness, while ValueWriter enforces a 255-byte post-encoding limit. Replacement character expansion breaks the invariant that a value read from the wire can always be written back.

Attack Vector

An authenticated attacker with permission to send RPC messages publishes a request containing a carefully crafted shortstr property with malformed UTF-8 bytes near the 255-byte boundary. When the RPC server echoes the property into its reply, writeShortstr rejects the oversized re-encoded value and throws. The broker requeues the poison message, and every consumer that replaces the failed one encounters the same exception.

java
// Patch excerpt from ValueReader.java — enforce shortstr length bound
+    /** Maximum length, in bytes, of a shortstr on the wire. */
+    private static final int MAX_SHORTSTR_LENGTH = 255;
+
     /** The stream we are reading from. */
     private final DataInputStream in;

Source: GitHub Commit b8bd750

Detection Methods for CVE-2026-106122

Indicators of Compromise

  • Repeated IllegalArgumentException or shortstr length errors emitted from RpcServer.mainloop() in application logs
  • A single AMQP message cycling through redeliveries with an incrementing redelivered or delivery count
  • Consumer processes repeatedly crashing or restarting while queue depth remains static

Detection Strategies

  • Monitor RabbitMQ broker metrics for queues where unacknowledged message counts remain pinned to one while consumer churn increases
  • Instrument the Java client to log the raw byte length of inbound shortstr properties and flag values that re-encode larger than they were read
  • Correlate exception stack traces referencing ValueWriter.writeShortstr with the publishing client identity for attribution

Monitoring Recommendations

  • Alert on consumer utilization dropping to zero while queue depth is non-zero on RPC reply queues
  • Track basic.deliver redelivery ratios and alert when any single message is redelivered beyond a defined threshold
  • Centralize JVM exception telemetry from RabbitMQ client applications into a SIEM for pattern analysis across hosts

How to Mitigate CVE-2026-106122

Immediate Actions Required

  • Upgrade the RabbitMQ Java client dependency to version 5.36.0 or later in all affected applications
  • Audit RPC-exposed services to confirm which permissions are required to publish messages and tighten them where possible
  • Purge any queue currently stuck in a redelivery loop after confirming the responsible message is non-business-critical

Patch Information

The fix is published in RabbitMQ Java client v5.36.0 via Pull Request #2065. The patched ValueReader enforces a MAX_SHORTSTR_LENGTH of 255 bytes during parsing, and RpcServer adds defensive logging around shortstr handling. Full technical details are documented in GHSA-7822-rcf6-97fx.

Workarounds

  • Wrap RpcServer.mainloop() consumer logic in try/catch blocks that acknowledge or reject-without-requeue on parsing failures to prevent poison-message loops
  • Configure dead-letter exchanges on RPC reply queues so repeatedly failing messages are automatically diverted after a redelivery threshold
  • Restrict publish permissions on RPC request exchanges to trusted producers only until the client library can be upgraded
bash
# Update Maven dependency to the patched version
mvn versions:use-dep-version \
  -Dincludes=com.rabbitmq:amqp-client \
  -DdepVersion=5.36.0 \
  -DforceVersion=true

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

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.