CVE-2026-75516
RabbitMQ Java client has frame-level OOM: Math.min(maxInboundMessageBodySize, 0) defeats frame size enforcement
Description
Vulnerability
In AMQConnection.java (line 435-436), after Connection.Tune negotiation, the frame-max limit is set via:
_frameHandler.setFrameMax(
Math.min(this.maxInboundMessageBodySize, frameMax));
When frameMax = 0 (meaning "unlimited" per AMQP spec), Math.min(67108864, 0) = 0. This value is then passed to Utils.framePayloadLimit(0) which returns Integer.MAX_VALUE (line 77-79 of Utils.java):
static int framePayloadLimit(int frameMax) {
if (frameMax <= 0) {
return Integer.MAX_VALUE;
}
// ...
}
This completely defeats the maxInboundMessageBodySize protection (default 64MB) at the frame level.
Attack Scenario
A malicious AMQP server (or MITM) sends Connection.Tune with frameMax=0:
- Client defaults:
requestedFrameMax = 0(ConnectionFactory.DEFAULT_FRAME_MAX, line 82) negotiatedMaxValue(0, 0)=Math.max(0, 0)= 0 (line 673-676)Math.min(maxInboundMessageBodySize, 0)= 0 — 64MB cap defeatedframePayloadLimit(0)=Integer.MAX_VALUE— no frame size enforcement- Attacker sends a single frame with
frameSize = 0x1FFFFFFF(~500MB) Frame.readFrom()(line 135) executesnew byte[frameSize]— OOM crash
The frame does not need to be a body frame — method frames, header frames, or heartbeat frames with a crafted size field all trigger the allocation before any content-level check fires.
Root Cause
The AMQP spec uses frameMax=0 to mean "unlimited", but Math.min treats it as the integer value zero. The intent of line 435-436 was to take the smaller of the two limits, but when one limit uses 0-means-unlimited semantics, Math.min always selects the zero, disabling the other limit.
Impact
- Default configuration is vulnerable: Both
requestedFrameMax(client) and legitimate servers'frameMaxin Tune may be 0 - Single-frame OOM: One malicious frame triggers up to ~2GB allocation (
Integer.MAX_VALUEbytes) - Bypasses existing protection:
maxInboundMessageBodySize(introduced to cap allocations at 64MB) is entirely defeated at the frame level - Different from ValueReader OOM: This is a frame-layer allocation in
Frame.readFrom(), not a value-layer allocation inValueReader.readBytes()
Affected Code
AMQConnection.java:435-436—Math.minwith 0-means-unlimitedUtils.java:77-79—framePayloadLimit(0)returnsInteger.MAX_VALUEFrame.java:135—new byte[frameSize]allocation siteConnectionFactory.java:82—DEFAULT_FRAME_MAX = 0
Suggested Fix
int effectiveFrameMax = (frameMax == 0)
? this.maxInboundMessageBodySize
: Math.min(this.maxInboundMessageBodySize, frameMax);
_frameHandler.setFrameMax(effectiveFrameMax);
This treats frameMax=0 as "use maxInboundMessageBodySize as the cap" instead of "zero".
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| com.rabbitmq » amqp-client | < 5.34.0 | 5.34.0 |
Blast radius
73% of the dependent artifacts (5,672) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 22,177 |
| 2 hops | 75,953 |
| 3 hops | 115,245 |
| 4 hops | 65,894 |
| 5 hops | 29,945 |
| 6 hops | 15,538 |
Most used dependents
- org.apache.spark » spark-sql3,174 usages
- org.apache.spark » spark-core2,899 usages
- org.apache.spark » spark-mllib831 usages
- org.apache.hive » hive-exec699 usages
- org.springframework.boot » spring-boot-starter-amqp691 usages
- org.apache.spark » spark-streaming670 usages
- org.apache.spark » spark-hive633 usages
- org.apache.camel.springboot » camel-core-starter558 usages
- org.nuxeo.ecm.core » nuxeo-core-api534 usages
- org.apache.spark » spark-catalyst502 usages
- org.apache.solr » solr-core500 usages
- org.apache.hive » hive-metastore480 usages
- org.apache.camel.springboot » camel-spring-boot-starter478 usages
- org.apache.synapse » synapse-core453 usages
- org.springframework.amqp » spring-rabbit405 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
- Webhttps://github.com/rabbitmq/rabbitmq-java-client/security/advisories/GHSA-jh4v-gfqj-7rhx
- Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2026-75516
- Webhttps://github.com/rabbitmq/rabbitmq-java-client/pull/2015
- Webhttps://github.com/rabbitmq/rabbitmq-java-client/pull/2016
- Webhttps://github.com/rabbitmq/rabbitmq-java-client/commit/6d7c2bfe89796ca34d3531098fb59dd657fea39e
- Webhttps://github.com/rabbitmq/rabbitmq-java-client/commit/e7f10bf99aee103dd9f64b3e52a725fc9f9d3763
- Packagehttps://github.com/rabbitmq/rabbitmq-java-client
- Webhttps://github.com/rabbitmq/rabbitmq-java-client/releases/tag/v5.34.0
