DHI-2yq4-pjbu-tywf-f4sm

Source
https://scout.docker.com/v/DHI-2yq4-pjbu-tywf-f4sm
Import Source
https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-2yq4-pjbu-tywf-f4sm.json
JSON Data
https://api.osv.dev/v1/vulns/DHI-2yq4-pjbu-tywf-f4sm
Upstream
  • GHSA-hqjp-fc45-wj4f
Published
2026-11-27T12:09:54Z
Modified
2026-11-27T12:15:13Z
Summary
### Summary
Details

Summary

In the LDAP backend's documented access queries the regular expression is the ACL. ${username} and the other variables are substituted into it with no escaping, so a principal whose name contains PCRE metacharacters rewrites the pattern that is supposed to constrain it and gains access to other principals' resources. This is an incomplete instance of the project's own hardening: commit f964a14cf9 (2026-07-03) added rabbit_re:escape/1 for exactly this problem and applied it to two backends, but not to LDAP.

Details

deps/rabbitmq_auth_backend_ldap/src/rabbit_auth_backend_ldap.erl:376:

evaluate0({string, StringPattern}, Args, _User, _LDAP) ->
    R = fill(StringPattern, Args),

reaching the matcher unchanged:

do_match(S1, S2) ->
    R = rabbit_re:matches(S1, S2),

rabbit_re:matches/2 calls re:run/3 with no anchoring, so a top-level alternation applies to the whole pattern. The substitution helper states its own limitation (rabbit_auth_backend_ldap_util.erl:12):

%% Raw substitution without escaping. Safe only for non-DN sinks (ACL string
%% comparisons, eldap:equalityMatch/2 filter values).

An ACL regex is not a string comparison. By contrast the internal backend does escape, at deps/rabbit/src/rabbit_auth_backend_internal.erl:222:

binary:replace(Acc, Placeholder, rabbit_re:escape(V), [global])

rabbit_re:escape/1 has exactly two production callers in the tree, that one and rabbit_auth_backend_oauth2.erl:538. LDAP is the one variable-into-pattern site that omits it. ${vhost}, ${name}, ${permission} and ${routing_key} reach the same sink.

Proof of concept

Run against the shipped functions inside a running broker. No directory server is needed, because the defect is in the substitution and matching, both broker-side.

rabbitmqctl eval 'rabbit_auth_backend_ldap_util:fill("^${username}-", [{username, "x|.*$|"}]).'
"^x|.*$|-"

The metacharacters survive. Now that pattern against the real matcher, with a benign username as the control:

rabbitmqctl eval '
  Benign = rabbit_auth_backend_ldap_util:fill("^${username}-", [{username, "bob"}]),
  Evil   = rabbit_auth_backend_ldap_util:fill("^${username}-", [{username, "x|.*$|"}]),
  Victim = "alice-private-queue",
  [{benign_matches_victim, rabbit_re:matches(Victim, Benign)},
   {evil_matches_victim,   rabbit_re:matches(Victim, Evil)},
   {evil_matches_anything, rabbit_re:matches("totally-unrelated-9f3a", Evil)}].'

[{benign_matches_victim,false},
 {evil_matches_victim,true},
 {evil_matches_anything,true}]

With an ordinary username the ACL correctly denies the victim queue. With x|.*$| the same ACL matches it, and every other name, because the .*$ alternative is evaluated at top level.

The query shape is the project's own: deps/rabbitmq_auth_backend_ldap/test/system_SUITE.erl carries {resource_access_query, {match, {string,"${name}"}, {string,"^${username}-"}}} and variants.

Impact

A principal presenting a name containing PCRE metacharacters obtains configure, write and read on queues and exchanges belonging to other principals in the same vhost, and with a topic_access_query of the same shape, publish and subscribe outside its permitted pattern.

Requires the LDAP backend to be enabled and an access query using the {match, _, _} form with an identity variable, which is the documented shape. The limiting precondition: the attacker must hold a directory identity whose name carries regex metacharacters. None of `| . * $ ( ) [ ]

  • ?is illegal in an OpenLDAPcn/uidor an ADuserPrincipalName, but names are usually assigned rather than chosen, which is why this is scored AC:H. Where self-service registration or rename exists it is AC:L` and scores 8.8.

Not tested end to end through a live directory; the two broker-side links containing the defect were run directly.

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

Type
ECOSYSTEM
Events
Introduced
4.3.5-0

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-2yq4-pjbu-tywf-f4sm.json"

Docker Hardened Images:Debian:13 / rabbitmq-4.4

Package

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

Affected ranges

Type
ECOSYSTEM
Events
Introduced
4.4.0-0

Affected versions

4.*
4.4.0-0
4.4.1-0
4.4.1-1
4.4.1-2
4.4.1-3

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-2yq4-pjbu-tywf-f4sm.json"