CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-85058

CVE-2026-85058: Missing Authorization in Moquette MQTT Broker Last Will and Testament Feature

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 19, 2026·8 min read·31 visits

Executive Summary (TL;DR)

Moquette MQTT broker versions before 0.18.1 fail to validate write permissions when executing a client's Last Will and Testament, enabling write-restricted or anonymous clients to publish to protected topics.

An authorization bypass vulnerability exists in the Moquette MQTT broker prior to version 0.18.1. When an MQTT client registers a Last Will and Testament (LWT) topic during its connection setup, the broker fails to perform write-access checks on that topic. Upon an abrupt client disconnection, the broker publishes the registered Will message to subscribers of the unauthorized topic, bypassing configured Access Control Lists (ACLs).

Vulnerability Overview

Moquette is a lightweight, Java-based MQTT broker widely utilized in resource-constrained contexts, enterprise Java integration layers, and IoT communication structures. The broker implements the standard MQTT protocol, which supports a reliability feature known as Last Will and Testament (LWT). The LWT mechanism allows a connecting client to specify an administrative or operational topic and a payload that the broker must publish if the client's connection terminates unexpectedly. This mechanism acts as an automated state-reporting function for distributed nodes.

In standard operating modes, Moquette uses an access control list (ACL) policy engine represented by the IAuthorizatorPolicy interface to restrict client publish and subscribe operations. These ACL policies are evaluated whenever a client issues an MQTT PUBLISH control packet to prevent unauthorized message injection. This security model ensures that write-restricted or anonymous clients cannot post data to critical command and control channels.

However, in versions of Moquette prior to 0.18.1, the message-routing logic completely bypassed authorization checks when executing the publication of a client's LWT. While standard publications are strictly vetted against ACL parameters, the LWT execution workflow did not query the authorization policy engine. Consequently, a client with restricted or non-existent write permissions could register an unauthorized topic as its LWT during the connection handshake and force the broker to publish to it by abruptly dropping the connection.

Root Cause Analysis

The root cause of CVE-2026-85058 is located in the session teardown handling logic within the core routing class broker/src/main/java/io/moquette/broker/PostOffice.java. When a client connects using an MQTT CONNECT packet, it submits its LWT parameters, including the target topic and the payload. The broker parses this packet and stores the LWT parameters inside the session repository database. Critically, Moquette does not perform authorization checks at the time of connection because no message has been published yet.

When a client disconnects abnormally, the network interface layer triggers a session teardown sequence. This sequence invokes the PostOffice.fireWill() method, which subsequently calls PostOffice.publishWill(ISessionsRepository.Will will). The broker builds an internal MqttPublishMessage structure from the stored session Will parameters.

In vulnerable versions, the compiled message was passed directly to the subscription distribution subsystem via publish2Subscribers(). Because the broker did not evaluate authorizator.canWrite() before dispatching the message, any registered LWT was successfully routed. The vulnerability is characterized as an architectural missing authorization flaw (CWE-862), where the broker trustingly processes internally generated publish events without validating the initial source's authorization privileges.

Code Analysis

To understand the vulnerability, look at the vulnerable implementation of the publishWill method in PostOffice.java prior to the patch. The method was structured to construct the message and immediately distribute it to matching subscribers:

// Vulnerable Code Path in PostOffice.java (Pre-0.18.1)
private void publishWill(ISessionsRepository.Will will) {
    // ... builds the MqttPublishMessage willPublishMessage from the stored Will ...
    MqttPublishMessage willPublishMessage = publishBuilder.build();
 
    // CRITICAL: The broker directly distributes the message without querying the authorizator
    publish2Subscribers(WILL_PUBLISHER, messageExpiryInstant, willPublishMessage);
}

The patch introduced in commit f5a323fe782d1505c0097498cb22eb6ec6c96973 addresses this by inserting an explicit access control validation check. If the check fails, the message is dropped and an error log is generated:

// Patched Code Path in PostOffice.java (0.18.1)
private void publishWill(ISessionsRepository.Will will) {
    // ... builds the MqttPublishMessage willPublishMessage from the stored Will ...
    MqttPublishMessage willPublishMessage = publishBuilder.build();
 
    // PATCH: Validate write access on the target LWT topic before distributing
    if (!authorizator.canWrite(Topic.asTopic(will.topic), "", WILL_PUBLISHER)) {
        LOG.error("client is not authorized to publish Last Will Testament on topic: {}", will.topic);
        return;
    }
    publish2Subscribers(WILL_PUBLISHER, messageExpiryInstant, willPublishMessage);
}

While this patch successfully mitigates the immediate bypass, security teams must note that the authorization query is evaluated using the hardcoded static identifier WILL_PUBLISHER and an empty string for the username parameter. This decoupling means that custom authorization policies must explicitly handle the WILL_PUBLISHER client ID to avoid locking out legitimate system notifications or accidentally permitting unauthorized operations if the policy engine treats empty strings or system identities permissively.

Exploitation Methodology

Exploitation of CVE-2026-85058 is highly reliable because it requires no complex memory alignment, advanced network positioning, or authentication credentials. The attack complexity is low and can be executed over standard TCP/IP. The attacker only needs network reachability to the Moquette broker instance.

First, the attacker establishes a connection to the broker. If anonymous access is permitted, the attacker connects without credentials. In the initial MQTT CONNECT control packet, the attacker registers a Will topic pointing to a restricted path, such as an administration or control channel, along with an arbitrary payload. The broker accepts the registration and associates it with the new session.

Second, the attacker triggers the execution of the LWT by forcing an unclean disconnection. This is achieved by closing the network socket or sending a TCP Reset (RST) packet. The attacker must avoid sending a clean MQTT DISCONNECT packet, as doing so instructs the broker to discard the registered LWT. Upon detecting the abrupt network loss, the broker executes the unvetted LWT and publishes the attacker's payload directly to the restricted topic.

Impact Assessment

The impact of this vulnerability is significant in environments where MQTT serves as a messaging backplane for sensitive or automated systems. By exploiting this flaw, write-restricted clients can inject arbitrary payloads into restricted topics, leading to unauthorized state modification, data injection, or spoofing. In industrial control or IoT deployments, this could allow unauthorized actors to issue control commands to downstream devices subscribing to restricted administrative channels.

The CVSS v3.1 base score is assessed at 7.5 (High), with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N. The exploitability subscore is 3.9, reflecting that the attack requires no user interaction, operates over the network, and can be executed with zero initial privileges. The impact is limited to integrity, with no immediate confidentiality or availability compromise resulting from the bypass itself.

While there is no active exploitation reported in the wild, the public availability of the functional regression test suite makes the vulnerability easy to weaponize. Security operations teams should prioritize remediation of this flaw due to the trivial nature of its execution.

Additional Moquette 0.18.1 Security Hardening

Moquette version 0.18.1 resolves several other critical security issues in addition to the LWT authorization bypass. These sibling vulnerabilities highlight the importance of upgrading the broker component:

  • Pattern-ACL Wildcard Injection (GHSA-9jjc-fw8x-fmwx sibling fix): Moquette failed to validate whether the client-provided clientID or username contained MQTT wildcard characters (+ or #). A client connecting with a clientID of + could match expanded rules like /sensor/+/data, bypassing tenant boundaries and gaining cross-tenant access.
  • Remote DoS via Null Username in Pattern ACLs: When pattern ACLs were active, anonymous clients connecting with a null username triggered a NullPointerException inside String.replace() during policy evaluation. This unhandled exception escaped the session loop, terminating the worker thread and denying service to other connected clients.
  • Persistent Queue Namespace Collision: Moquette used H2's MVStore to persist client queues, naming the maps based on the client ID. Attackers could register a client ID that overlapped with another client's metadata map, leading to durable data loss or cross-session message leakage.
  • Malformed Shared Subscription Crash: Clients subscribing to a malformed MQTT v5 shared subscription triggered a StringIndexOutOfBoundsException during parsing, leading to uncaught exceptions that crashed command handling on the shared session event loop.
  • Recursion-based Stack Overflow: Highly nested topic paths containing thousands of segments triggered a recursive loop inside the broker's concurrent trie, resulting in a StackOverflowError that crashed the JVM instance.

Remediation and Mitigation

The primary recommendation is to upgrade Moquette to version 0.18.1 or higher. This version addresses the LWT authorization bypass, resolves the secondary denial of service bugs, and patches the concurrent trie recursion issues. Upgrading represents the most comprehensive path to securing the broker infrastructure.

If upgrading is not immediately possible, security teams should implement temporary workarounds to reduce the attack surface. First, disable anonymous access to restrict connection capabilities to authenticated entities. This prevents completely unauthorized actors from registering LWT packets:

# moquette.conf
allow_anonymous false

Second, review all custom implementations of IAuthorizatorPolicy. Ensure that policy logic does not grant implicit write access to empty usernames or the hardcoded WILL_PUBLISHER client ID. Finally, implement network-level rate limiting on connection churn to mitigate automated exploitation attempts that rely on rapid connect and disconnect sequences.

Official Patches

moquette-ioMoquette GitHub Security Advisory GHSA-9jjc-fw8x-fmwx
moquette-ioMoquette Broker Version 0.18.1 Release Notes

Fix Analysis (2)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Affected Systems

Moquette MQTT Brokerio.moquette:moquette-broker

Affected Versions Detail

Product
Affected Versions
Fixed Version
moquette-broker
moquette-io
< 0.18.10.18.1
AttributeDetail
CWE IDCWE-862
Attack VectorNetwork
CVSS v3.1 Score7.5 (High)
EPSS ScoreNot Available
ImpactIntegrity (High)
Exploit StatusPoC (Proof of Concept)
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-862
Missing Authorization

The product does not perform an authorization check when an actor attempts to access a resource or perform an action, allowing unauthorized actors to perform operations.

Known Exploits & Detection

GitHubIntegration test WillUnauthorizedPublishTest.java validating and demonstrating the LWT authorization bypass mechanism.

References & Sources

  • [1]Moquette GitHub Security Advisory GHSA-9jjc-fw8x-fmwx
  • [2]NVD CVE-2026-85058 Detail
  • [3]CVE.org CVE-2026-85058 Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 minutes ago•CVE-2026-126297
7.5

CVE-2026-126297: Algorithmic Complexity Denial of Service in NLTK ConllCorpusReader

CVE-2026-126297 (GHSA-v8f3-6phw-6mh9) is an uncontrolled resource consumption and algorithmic complexity vulnerability in the Natural Language Toolkit (NLTK) prior to version 3.10.4. Located in the Semantic Role Labeling (SRL) parser within `nltk/corpus/reader/conll.py`, the flaw allows an attacker to trigger quadratic O(N^2) CPU processing overhead by providing crafted CoNLL-formatted corpus inputs containing decoy span columns or nested full-width verb spans. Applications parsing untrusted linguistic corpora can experience prolonged CPU exhaustion and application-level Denial of Service (DoS).

Amit Schendel
Amit Schendel
0 views•12 min read
•about 1 hour ago•CVE-2026-126298
7.5

CVE-2026-126298: Quadratic Algorithmic Complexity Denial of Service in NLTK Tree.chomsky_normal_form

CVE-2026-126298 (also tracked as GHSA-r53h-rw34-8h97) is an algorithmic complexity Denial of Service (DoS) vulnerability in the Natural Language Toolkit (NLTK) Python library affecting all versions prior to 3.10.4. The vulnerability resides in the nltk.tree.transforms.chomsky_normal_form function and its corresponding public method Tree.chomsky_normal_form(). When transforming a parse tree into Chomsky Normal Form using the default right-factoring strategy, the function repeatedly invokes list.pop(0) inside a loop iterating over all children of a node. In CPython, removing the initial element of a standard list requires an O(N) memory shift operation, causing the overall binarization algorithm to degrade to O(N^2) quadratic time complexity relative to the width of a node. Furthermore, converting horizontal node width into vertical tree depth bypasses initial parsing depth bounds, triggering subsequent stack exhaustion (RecursionError) when recursive methods traverse the mutated structure. Unauthenticated remote attackers who can submit bracketed tree strings to applications invoking this transformation can exhaust single-threaded CPU resources or induce unhandled application exceptions.

Alon Barad
Alon Barad
3 views•12 min read
•about 2 hours ago•CVE-2026-126299
7.5

CVE-2026-126299: Quadratic Algorithmic Complexity Denial of Service in NLTK CCG Lexicon Parser

An algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) before version 3.10.4 allows remote unauthenticated attackers to cause a denial of service via crafted Combinatory Categorial Grammar (CCG) lexicon strings. The parser in nltk.ccg.lexicon.fromstring performs repeated immutable string slicing, concatenation, and regex tail capturing, resulting in O(n^2) CPU consumption when processing wide, flat category definitions.

Alon Barad
Alon Barad
4 views•10 min read
•about 3 hours ago•CVE-2026-126295
7.1

CVE-2026-126295: Path Traversal and Unconfined File Access in NLTK BllipParser

CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.

Amit Schendel
Amit Schendel
2 views•11 min read
•about 4 hours ago•CVE-2026-126300
5.3

CVE-2026-126300: Algorithmic Complexity Denial of Service in NLTK TreebankWordTokenizer.span_tokenize

CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.

Amit Schendel
Amit Schendel
3 views•10 min read
•about 5 hours ago•GHSA-GPWC-27CW-RH9R
5.3

CVE-2026-126301: Quadratic CPU Exhaustion in NLTK LegalitySyllableTokenizer

The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.

Amit Schendel
Amit Schendel
5 views•10 min read