RabbitMQ 不完全なAMQP 0-9-1メッセージでメモリを大量消費される
Summary
ログイン済みの利用者が、宣言した本文を最後まで送らずに大量のデータを保持させることで、サーバーのメモリを枯渇させられる脆弱性です。影響を受けるのは rabbitmq-server の 3.13.21 より前、4.1.17 より前、4.2.12 より前、4.3.7 より前の版です。修正版として 3.13.21、4.1.17、4.2.12、4.3.7 が公開されているため、これらへの更新をおすすめします。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
ログイン済みの利用者が、宣言した本文を最後まで送らずに大量のデータを保持させることで、サーバーのメモリを枯渇させられる脆弱性です。影響を受けるのは rabbitmq-server の 3.13.21 より前、4.1.17 より前、4.2.12 より前、4.3.7 より前の版です。修正版として 3.13.21、4.1.17、4.2.12、4.3.7 が公開されているため、これらへの更新をおすすめします。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| rabbitmqrabbitmq-server |
>= 4.3.0, < 4.3.7→ 4.3.7 |
4.3.7 |
| rabbitmqrabbitmq-server |
>= 4.2.0, < 4.2.12→ 4.2.12 |
4.2.12 |
| rabbitmqrabbitmq-server |
>= 4.1.0, < 4.1.17→ 4.1.17 |
4.1.17 |
| rabbitmqrabbitmq-server |
>= 3.13.0, < 3.13.21→ 3.13.21 |
3.13.21 |
Original description The description as published by the source.
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),…
Source: GitHub Repository Security Advisories (Game のスタック) GitHub Advisory OSV
References
- GITHUB_REPO_ADVISORY rabbitmq/rabbitmq-server