/

CVE-2026-67407

Severity:

HIGH RISK

(7.1)

Authorization Bypass (CWE-862) in RabbitMQ MQTT Broker

CVE-2026-67407

Analyzed

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-862

Impact:

Unauthorized MQTT Topic Read and Write Access

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

RabbitMQ contains an authorization bypass in MQTT topic permission expansion when a topic template places {clientid} inside a character class. Because the affected escaping logic does not handle the hyphen character, a low-privileged authenticated MQTT user who controls its client identifier may broaden permitted topic read or write access.

RabbitMQ contains an authorization bypass in MQTT topic permission expansion when a topic template places {clientid} inside a character class. Because the affected escaping logic does not handle the hyphen character, a low-privileged authenticated MQTT user who controls its client identifier may broaden permitted topic read or write access.

Affected context

The issue affects RabbitMQ deployments using MQTT topic permission templates that interpolate a client-controlled {clientid} value inside a regular-expression character class such as [...]. It is relevant when topic authorization relies on the expanded template and the resulting pattern is evaluated without correctly escaping hyphens.

The issue affects RabbitMQ deployments using MQTT topic permission templates that interpolate a client-controlled {clientid} value inside a regular-expression character class such as [...]. It is relevant when topic authorization relies on the expanded template and the resulting pattern is evaluated without correctly escaping hyphens.

Exploit preconditions

  • Attack surface: MQTT topic authorization and permission-template expansion
  • Required access: An authenticated, low-privileged MQTT account with control over its client identifier
  • Trigger point: Evaluation of a topic permission template containing {clientid} within a character class
  • Why exploitation is possible: The escaping routine protects several regular-expression metacharacters but omits -, allowing the client-controlled value to alter the effective authorization pattern
  • Attack surface: MQTT topic authorization and permission-template expansion
  • Required access: An authenticated, low-privileged MQTT account with control over its client identifier
  • Trigger point: Evaluation of a topic permission template containing {clientid} within a character class
  • Why exploitation is possible: The escaping routine protects several regular-expression metacharacters but omits -, allowing the client-controlled value to alter the effective authorization pattern

Why this happens

The underlying bug is incomplete neutralization of user-controlled data before it is embedded in a regular-expression-based authorization rule. A hyphen has special meaning inside a regular-expression character class, where it can define a character range. Omitting that character from the escaping routine allows a crafted client identifier to broaden the topics matched by the permission template. This behavior maps to CWE-862: Missing Authorization, because the resulting rule may grant access beyond the user's intended topic scope.

The underlying bug is incomplete neutralization of user-controlled data before it is embedded in a regular-expression-based authorization rule. A hyphen has special meaning inside a regular-expression character class, where it can define a character range. Omitting that character from the escaping routine allows a crafted client identifier to broaden the topics matched by the permission template. This behavior maps to CWE-862: Missing Authorization, because the resulting rule may grant access beyond the user's intended topic scope.

Potential impact

  • An attacker may read MQTT topics outside the intended authorization scope
  • An attacker may publish to topics they should not be able to write
  • Sensitive messages or telemetry could be disclosed
  • Unauthorized clients could alter application inputs or brokered commands
  • Downstream systems may process tampered messages
  • An attacker may read MQTT topics outside the intended authorization scope
  • An attacker may publish to topics they should not be able to write
  • Sensitive messages or telemetry could be disclosed
  • Unauthorized clients could alter application inputs or brokered commands
  • Downstream systems may process tampered messages

General mitigation guidance

Mitigation generally focuses on preventing client-controlled identifiers from changing authorization semantics.

Common defensive patterns include:

  • Escape every regular-expression metacharacter, including hyphens in character classes, before interpolating values into permission patterns
  • Prefer exact topic matching or structured authorization rules over dynamically assembled regular expressions
  • Treat MQTT client identifiers as untrusted input regardless of authentication status
  • Apply least-privilege topic permissions with separate, narrowly scoped read and write policies
  • Validate permission templates and expanded rules against representative edge-case identifiers before deployment
  • Avoid relying on client-controlled values for security boundaries where a server-assigned identifier is practical

Mitigation generally focuses on preventing client-controlled identifiers from changing authorization semantics.

Common defensive patterns include:

  • Escape every regular-expression metacharacter, including hyphens in character classes, before interpolating values into permission patterns
  • Prefer exact topic matching or structured authorization rules over dynamically assembled regular expressions
  • Treat MQTT client identifiers as untrusted input regardless of authentication status
  • Apply least-privilege topic permissions with separate, narrowly scoped read and write policies
  • Validate permission templates and expanded rules against representative edge-case identifiers before deployment
  • Avoid relying on client-controlled values for security boundaries where a server-assigned identifier is practical

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules that identify regular-expression construction from client-controlled values
  • Code review checks for incomplete escaping routines and special handling of characters inside [...]
  • Tests using hyphens, backslashes, brackets, and other regular-expression boundary characters in client identifiers
  • Authorization regression tests confirming that expanded MQTT permissions cannot match unintended topic names
  • Policy enforcement requiring centralized, well-tested authorization libraries instead of ad hoc pattern construction
  • Automated security review tools that flag dynamic regular-expression assembly and missing authorization checks

Organizations can look for this class of issue through:

  • Static analysis rules that identify regular-expression construction from client-controlled values
  • Code review checks for incomplete escaping routines and special handling of characters inside [...]
  • Tests using hyphens, backslashes, brackets, and other regular-expression boundary characters in client identifiers
  • Authorization regression tests confirming that expanded MQTT permissions cannot match unintended topic names
  • Policy enforcement requiring centralized, well-tested authorization libraries instead of ad hoc pattern construction
  • Automated security review tools that flag dynamic regular-expression assembly and missing authorization checks

Sources

SourceLink
github.comgithub.com/rabbitmq/rabbitmq-server/releases/tag/v4.2.9
github.comgithub.com/rabbitmq/rabbitmq-server/releases/tag/v4.3.3
github.comgithub.com/rabbitmq/rabbitmq-server/security/advisories/GHSA-q46v-hrvq-hp24

Frequently asked

questions

It can be exploitable through the MQTT service when a deployment uses the affected topic permission-template pattern and permits an authenticated user to control its client identifier.

The attacker generally needs a valid low-privileged MQTT account and the ability to establish a connection with a chosen client identifier. Anonymous access is not required if authenticated access is available.

Ensure all client-controlled values are fully escaped for their exact regular-expression context, or replace dynamic regular-expression authorization with explicit topic rules and server-controlled identifiers.

Use deny-by-default topic permissions, test authorization with metacharacter edge cases, review interpolation and escaping code carefully, and enforce least privilege for MQTT read and write access.

It can be exploitable through the MQTT service when a deployment uses the affected topic permission-template pattern and permits an authenticated user to control its client identifier.

The attacker generally needs a valid low-privileged MQTT account and the ability to establish a connection with a chosen client identifier. Anonymous access is not required if authenticated access is available.

Ensure all client-controlled values are fully escaped for their exact regular-expression context, or replace dynamic regular-expression authorization with explicit topic rules and server-controlled identifiers.

Use deny-by-default topic permissions, test authorization with metacharacter edge cases, review interpolation and escaping code carefully, and enforce least privilege for MQTT read and write access.

Find out what's already
exploitable in your codebase.