/

CVE-2026-85724

Severity:

CRITICAL RISK

(9.6)

MQTT ACL Filter Injection (CWE-155) in Moquette Broker

CVE-2026-85724

Analyzed

Vulnerability type

Category:

Improper Neutralization of Wildcards

CWE:

CWE-155, CWE-863

Impact:

Unauthorized cross-tenant topic access and denial of service

Severity:

CRITICAL RISK

(9.6)

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

Moquette contains an authorization flaw in pattern-based MQTT ACL rules that can let specially formed client IDs or usernames alter the meaning of substituted topic filters. In affected configurations, an attacker may gain cross-tenant read or write access, while certain malformed identities may also disrupt session processing.

Affected context

The issue occurs in Moquette deployments that use pattern-based ACL rules with identity substitutions such as %c or %u. It becomes risky when client-supplied IDs or usernames are inserted into topic filters without ensuring that MQTT wildcard characters remain data rather than filter syntax.

Exploit preconditions

  • Attack surface: MQTT authentication and authorization handling
  • Required access: The ability to connect with a client identity accepted by the broker
  • Trigger point: Authorization checks that substitute the client ID or username into a pattern-based ACL rule
  • Why exploitation is possible: Wildcard characters in the identity can broaden the resulting topic filter or create an invalid filter before authorization is completed

Why this happens

The underlying bug is improper neutralization of wildcard and matching characters, mapped primarily to CWE-155. Moquette substitutes client-controlled identity values into ACL patterns and then interprets the combined result as an MQTT topic filter. Without context-aware escaping, validation, or a strict separation between literal identity data and filter syntax, attacker-controlled characters can change authorization semantics. The resulting access-control failure is also related to CWE-863, Incorrect Authorization.

Potential impact

  • An attacker may read topics belonging to other tenants.
  • An attacker may publish or modify messages in unauthorized topics.
  • Sensitive MQTT data may be disclosed across authorization boundaries.
  • A malformed identity may trigger processing errors and cause session disruption.
  • Dependent applications may experience data integrity or availability issues.

General mitigation guidance

Mitigation generally focuses on preserving the distinction between literal

identity values and MQTT filter syntax.

Common defensive patterns include:

  • Escaping or rejecting wildcard characters when identity values are inserted into ACL patterns.
  • Using structured authorization rules that compare identities and topics as separate fields.
  • Applying strict validation and canonicalization to client IDs and usernames.
  • Enforcing tenant-scoped topic authorization by default and denying ambiguous filters.
  • Handling invalid filters safely without allowing authorization failures to disrupt sessions.
  • Running broker processes with only the permissions required for messaging operations.
  • Protecting ACL configuration from unauthorized modification and testing rules with adversarial identity values.

How teams detect issues like this

Organizations can look for this issue through:

  • Static analysis patterns that identify string substitution into authorization or topic-filter logic.
  • Code review checks for unescaped client-controlled values used in wildcard-aware APIs.
  • Tests covering plus and hash characters, malformed filters, empty identities, and tenant-boundary access.
  • Runtime monitoring for unexpected cross-tenant subscriptions or publications.
  • Policy enforcement requiring explicit tenant scoping and deny-by-default ACL behavior.
  • Automated security review tools that flag authorization decisions built from untrusted string concatenation.

Sources

SourceLink
github.comgithub.com/moquette-io/moquette/commit/b4a98bb3f3425ece476ed073aa080c627c1239af
github.comgithub.com/moquette-io/moquette/releases/tag/v0.18.1
github.comgithub.com/moquette-io/moquette/security/advisories/GHSA-5f42-97gr-vfhq

Frequently asked

questions

Yes, when the broker accepts network connections and the attacker can authenticate

or otherwise establish a session using a client identity that reaches the affected

ACL evaluation path.

The key requirement is access to submit a client ID or username during MQTT

connection setup. The identity must also be accepted sufficiently for the

authorization checks to execute.

Treat client IDs and usernames as literal data, not as ACL syntax. Validate or

reject wildcard characters, use structured authorization comparisons, and handle

invalid topic filters safely.

Test authorization boundaries with special characters and malformed values, use

deny-by-default tenant-scoped policies, and review every path where untrusted

identity data is interpolated into wildcard-aware matching functions.

Find out what's already
exploitable in your codebase.