GHSA-jh4v-gfqj-7rhx

Suggest an improvement
Source
https://github.com/advisories/GHSA-jh4v-gfqj-7rhx
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-jh4v-gfqj-7rhx/GHSA-jh4v-gfqj-7rhx.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-jh4v-gfqj-7rhx
Aliases
Downstream
CGA (36)
MINI (11)
Published
2026-09-17T14:52:21Z
Modified
2026-09-17T15:00:05Z
Severity
  • 8.7 (High) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N CVSS Calculator
Summary
RabbitMQ Java client has frame-level OOM: Math.min(maxInboundMessageBodySize, 0) defeats frame size enforcement
Details

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:

  1. Client defaults: requestedFrameMax = 0 (ConnectionFactory.DEFAULT_FRAME_MAX, line 82)
  2. negotiatedMaxValue(0, 0) = Math.max(0, 0) = 0 (line 673-676)
  3. Math.min(maxInboundMessageBodySize, 0) = 0 — 64MB cap defeated
  4. framePayloadLimit(0) = Integer.MAX_VALUE — no frame size enforcement
  5. Attacker sends a single frame with frameSize = 0x1FFFFFFF (~500MB)
  6. Frame.readFrom() (line 135) executes new 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' frameMax in Tune may be 0
  • Single-frame OOM: One malicious frame triggers up to ~2GB allocation (Integer.MAX_VALUE bytes)
  • 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 in ValueReader.readBytes()

Affected Code

  • AMQConnection.java:435-436Math.min with 0-means-unlimited
  • Utils.java:77-79framePayloadLimit(0) returns Integer.MAX_VALUE
  • Frame.java:135new byte[frameSize] allocation site
  • ConnectionFactory.java:82DEFAULT_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".

Database specific
{
    "cwe_ids":  [
        "CWE-770"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-09-17T14:52:21Z",
    "nvd_published_at":  "2026-09-16T19:17:33Z",
    "severity":  "HIGH"
}
References

Affected packages

Maven / com.rabbitmq:amqp-client

Package

Name
com.rabbitmq:amqp-client
View open source insights on deps.dev
Purl
pkg:maven/com.rabbitmq/amqp-client

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
5.34.0

Affected versions

1.*
1.3.0
1.5.4
1.5.5
1.6.0
1.7.2
1.8.0
1.8.1
2.*
2.0.0
2.1.0
2.1.1
2.2.0
2.3.0
2.3.1
2.4.1
2.5.0
2.5.1
2.6.0
2.6.1
2.7.0
2.7.1
2.8.0
2.8.1
2.8.2
2.8.3
2.8.4
2.8.5
2.8.6
2.8.7
3.*
3.0.0
3.0.1
3.0.2
3.0.3
3.0.4
3.1.0
3.1.1
3.1.2
3.1.3
3.1.4
3.2.0
3.2.1
3.2.2
3.2.3
3.2.4
3.3.0
3.3.1
3.3.2
3.3.3
3.3.4
3.3.5
3.4.0
3.4.1
3.4.2
3.4.3
3.4.4
3.5.0
3.5.1
3.5.2
3.5.3
3.5.4
3.5.5
3.5.6
3.5.7
3.6.0
3.6.1
3.6.2
3.6.3
3.6.4
3.6.5
3.6.6
4.*
4.0.0
4.0.1
4.0.2
4.0.3
4.1.0
4.1.1
4.2.0
4.2.1
4.2.2
4.3.0
4.4.0
4.4.1
4.4.2
4.5.0
4.6.0
4.7.0
4.8.0
4.8.1
4.8.2
4.8.3
4.9.0
4.9.1
4.9.2
4.9.3
4.10.0
4.11.0
4.11.1
4.11.2
4.11.3
4.12.0
5.*
5.0.0
5.1.0
5.1.1
5.1.2
5.2.0
5.3.0
5.4.0
5.4.1
5.4.2
5.4.3
5.5.0
5.5.1
5.5.2
5.5.3
5.6.0
5.7.0
5.7.1
5.7.2
5.7.3
5.8.0
5.9.0
5.10.0
5.11.0
5.12.0
5.13.0
5.13.1
5.14.0
5.14.1
5.14.2
5.14.3
5.15.0
5.16.0
5.16.1
5.17.0
5.17.1
5.18.0
5.19.0
5.20.0
5.21.0
5.22.0
5.23.0
5.24.0
5.25.0
5.26.0
5.27.0
5.27.1
5.28.0
5.29.0
5.30.0
5.31.0
5.32.0
5.33.0
5.33.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-jh4v-gfqj-7rhx/GHSA-jh4v-gfqj-7rhx.json"