/

CVE-2026-85058

Severity:

HIGH RISK

(7.5)

Authorization Bypass (CWE-862) in Moquette MQTT Broker

CVE-2026-85058

Deferred

Vulnerability type

Category:

Missing Authorization

CWE:

CWE-862

Impact:

Unauthorized MQTT message publication

Severity:

HIGH RISK

(7.5)

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 bypass in the Last Will publication path. When anonymous access is enabled and topic ACLs restrict writes, a remote client may cause attacker-controlled messages to be published to a protected MQTT topic without write permission.

Affected context

The issue occurs in Moquette deployments that permit anonymous client access and use topic-level write ACLs. It affects Last Will handling during client connection and abnormal disconnection, where the broker's publication path may differ from the normal PUBLISH authorization flow.

Exploit preconditions

  • Attack surface: Network-accessible MQTT broker
  • Required access: Ability to connect as an anonymous or otherwise permitted MQTT client
  • Trigger point: Setting a Last Will topic during CONNECT followed by an abnormal client disconnect
  • Why exploitation is possible: The Last Will publication path can deliver client-controlled content without applying the authorization check used for ordinary publications

Why this happens

The vulnerability results from inconsistent authorization enforcement across MQTT message publication paths. The Last Will handler invokes subscriber delivery without performing the corresponding write-permission check, allowing a client to publish through a secondary broker workflow despite topic ACL restrictions. This maps to CWE-862: Missing Authorization, in which an operation is performed without verifying that the requester has the required permission.

Potential impact

  • Unauthorized messages may be published to ACL-protected topics
  • Applications consuming affected topics could receive forged or misleading data
  • Monitoring, automation, or control workflows may be triggered unexpectedly
  • Message integrity and tenant isolation could be weakened

General mitigation guidance

Mitigation generally focuses on applying authorization consistently to every message publication path, including Last Will processing.

Common defensive patterns include:

  • Enforcing topic write authorization before publishing any Last Will message
  • Centralizing publication checks so alternate delivery paths cannot bypass policy
  • Disabling anonymous access unless it is explicitly required
  • Using deny-by-default topic ACLs and narrowly scoped client permissions
  • Separating broker identities and tenant namespaces to limit cross-client impact
  • Treating client-provided Last Will topics as untrusted input

How teams detect issues like this

Organizations can assess this risk through:

  • Static analysis for publication methods that bypass shared authorization routines
  • Code review checks covering CONNECT, disconnect, retained-message, and Last Will paths
  • Integration tests verifying that unauthorized clients cannot publish through alternate broker workflows
  • Runtime policy monitoring for publishes to protected topics by clients lacking write permissions
  • Automated security review tools that identify inconsistent access-control enforcement

Sources

SourceLink
github.comgithub.com/moquette-io/moquette/commit/e23df019f6a11e22c7d2047d4f86d07095466c97
github.comgithub.com/moquette-io/moquette/commit/f5a323fe782d1505c0097498cb22eb6ec6c96973
github.comgithub.com/moquette-io/moquette/releases/tag/v0.18.1
github.comgithub.com/moquette-io/moquette/security/advisories/GHSA-9jjc-fw8x-fmwx

Frequently asked

questions

Yes, within deployments that expose the MQTT broker to clients and permit the required connection behavior. Anonymous access and restrictive topic ACLs are important conditions.

No. The issue is that a client may use the Last Will workflow to publish without the normal topic write authorization being applied.

Ensure that every broker publication path, including Last Will processing, invokes the same centralized authorization checks before message delivery.

Use deny-by-default ACLs, minimize anonymous access, test alternate protocol workflows, and review all message paths for consistent authorization enforcement.

Find out what's already
exploitable in your codebase.