DHI-h5jn-ppz7-wsqw-hx2r

Source
https://scout.docker.com/v/DHI-h5jn-ppz7-wsqw-hx2r
Import Source
https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-h5jn-ppz7-wsqw-hx2r.json
JSON Data
https://api.osv.dev/v1/vulns/DHI-h5jn-ppz7-wsqw-hx2r
Upstream
  • GHSA-9h6g-46wc-m2f5
Published
2026-11-11T23:10:18Z
Modified
2026-11-16T02:35:26Z
Summary
Any logged-in user can send a content header that declares a large body (the assembler accepts up to the hard 512 MiB…
Details

Any logged-in user can send a content header that declares a large body (the assembler accepts up to the hard 512 MiB gate) and then simply not send the last body frame. The server keeps every received body fragment in memory. max_message_size (default 16 MiB) is only checked after the final body frame arrives (rabbit_channel:check_msg_size/3), so for an unfinished message it never runs.

One connection can open up to 2,047 channels, and each channel can hold its own in-flight body. Demonstrated: one channel held ~300 MiB (18.75x the configured limit); 16 parallel holds reached ~2 GiB. No memory alarm fired: in containers vm_memory_monitor reads the host's MemTotal, not the cgroup limit, so the alarm threshold is unreachable and the endpoint is an OOM kill. On bare metal the endpoint is the memory watermark blocking all publishers node-wide.

Code

deps/rabbit_common/src/rabbit_command_assembler.erl - the content header is checked against the hard 512 MiB gate only. The declared BodySize is known here, before any fragment is stored, but max_message_size is not consulted; body fragments are then accumulated with no size check:

%% deps/rabbit_common/include/rabbit.hrl
-define(MAX_MSG_SIZE, 536_870_912).

%% deps/rabbit_common/src/rabbit_command_assembler.erl
process({content_header, ClassId, 0, BodySize, PropertiesBin},
        {content_header, Method, ClassId})
  when BodySize =< ?MAX_MSG_SIZE ->
    Content = empty_content(ClassId, PropertiesBin),
    {ok, {content_body, Method, BodySize, Content}};
%% ...
process({content_body, FragmentBin},
        {content_body, Method, RemainingSize,
         Content = #content{payload_fragments_rev = Fragments}})
  when byte_size(FragmentBin) =< RemainingSize ->
    NewContent = Content#content{
                   payload_fragments_rev = [FragmentBin | Fragments]},
    case RemainingSize - byte_size(FragmentBin) of
        0  -> {ok, Method, NewContent, method};
        Sz -> {ok, {content_body, Method, Sz, NewContent}}
    end;

deps/rabbit/src/rabbit_channel.erl - check_msg_size/2 does compare against max_message_size, but it is only reached from handle_method(#'basic.publish'{}, Content, State), which the reader calls once the assembler has returned a complete message, i.e. after the final body frame. For a message whose last frame never arrives, this code never runs:

handle_method(#'basic.publish'{exchange = ExchangeNameBin, ...},
              Content, State0 = ...) ->
    State1 = maybe_increase_global_publishers(State0),
    rabbit_global_counters:messages_received(amqp091, 1),
    check_msg_size(Content, GCThreshold),
    ...

check_msg_size(Content, GCThreshold) ->
    MaxMessageSize = persistent_term:get(max_message_size),
    Size = rabbit_basic:maybe_gc_large_msg(Content, GCThreshold),
    case Size =< MaxMessageSize of
        true ->
            rabbit_msg_size_metrics:observe(amqp091, Size);
        false ->
            ...
            rabbit_misc:precondition_failed(Fmt, [Size, MaxMessageSize])
    end.

Steps to reproduce

  1. Authenticate and open a channel
  2. Send basic.publish, then a content header with a large declared body size (e.g. 300 MiB)
  3. Send body frames but withhold the last one; keep the connection alive
  4. Repeat on more channels/connections; watch broker memory grow with no alarm

Suggested fix

Check the header-declared body size against max_message_size when the content header arrives, before buffering any fragments.

Severity

  • CVSS 4.0: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N (7.1, High)
  • CWE-770

Environment

  • RabbitMQ built from main at 851fb71306; re-verified unfixed at e0cc4a0bfc (October 1, 2026).
  • Erlang/OTP 27.3.4.9, Linux (containerized, cgroup v2).

Note: this replaces issue 1 of the combined report GHSA-3v49-p897-q679, split into individual reports as offered there. Full reproduction scripts and logs available on request.

References

Affected packages

Docker Hardened Images:Debian:13 / rabbitmq-4.3

Package

Name
rabbitmq-4.3
Purl
pkg:deb/dhi/rabbitmq-4.3

Affected ranges

Affected versions

4.*
4.3.5-0
4.3.5-1
4.3.6-0
4.3.6-1
4.3.6-2

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-h5jn-ppz7-wsqw-hx2r.json"