Nov 21, 2026·12 min read·1 visit
An unauthenticated remote attacker can crash an Aedes MQTT broker (versions < 1.1.1) with a single MQTT packet by supplying a topic string with more than 100 forward-slash-delimited levels, triggering an uncaught synchronous exception in the underlying qlobber routing dependency.
CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.
Aedes (moscajs/aedes) is a barebone MQTT broker designed to run on any stream server within the Node.js ecosystem. It serves as the successor to the Mosca broker and is widely integrated into IoT gateways, messaging pipelines, and microservice architectures to manage publish-subscribe telemetry over TCP and WebSockets. Because MQTT brokers sit at the boundary of device networks and process arbitrary wire-protocol packets from untrusted clients, input parsing and routing handlers represent a critical attack surface.
In versions of Aedes prior to 1.1.1, the broker fails to enforce structural depth bounds on MQTT topic strings submitted via client control packets. MQTT topics use forward slashes (/) as hierarchical level delimiters (for example, telemetry/region-1/device-42/status). When Aedes processes a topic string, it delegates subscription matching and message emission to mqemitter, which relies on the qlobber library to construct and traverse an in-memory radix trie of topic levels.
The vulnerability is classified under CWE-248 (Uncaught Exception), CWE-400 (Uncontrolled Resource Consumption), and CWE-754 (Improper Check for Unusual or Exceptional Conditions). When a client transmits a topic containing more than 100 hierarchical levels, qlobber rejects the input by throwing a synchronous JavaScript Error('too many words'). Aedes does not wrap these routing invocations in try/catch blocks or pre-validate topic depth.
Consequently, the synchronous exception escapes the internal message dispatch callbacks and propagates directly to the top of the Node.js event loop. Under standard Node.js runtime behavior, an unhandled synchronous exception causes the runtime to emit an uncaughtException event and terminate the process with exit code 1. In default Aedes configurations where anonymous client connections are permitted, an unauthenticated remote attacker can terminate the broker with a single network packet.
To understand the mechanics of CVE-2026-63341, it is necessary to examine the dependency chain linking Aedes wire protocol handlers to the underlying trie matcher. Aedes uses mqemitter as its internal event emitter for pub/sub message routing. In turn, mqemitter instantiates a Qlobber object (from the qlobber package) configured with the MQTT separator / and wildcards + and #.
Inside lib/qlobber.js, the Qlobber constructor sets an internal safeguard threshold designed to prevent excessive recursion and memory exhaustion during trie traversal: this._max_words = 100. Whenever a topic is added, removed, or matched against the trie, qlobber invokes its internal _split_words method to tokenize the topic string around the / delimiter. If the resulting array length exceeds _max_words, _split_words synchronously throws an error:
// Inside qlobber (lib/qlobber.js)
Qlobber.prototype._split_words = function (topic) {
// ... tokenization logic ...
if (r.length > this._max_words) {
throw new Error('too many words')
}
return r
}The root cause in Aedes is a mismatch between the contract expected by qlobber and the input validation performed by Aedes' protocol handlers. In lib/utils.js, Aedes provides a validateTopic helper function used by SUBSCRIBE and UNSUBSCRIBE handlers to verify compliance with the MQTT specification (checking for zero-length strings, invalid wildcard placement, and null characters). Prior to version 1.1.1, validateTopic performed no check on the number of / delimiters present in the string, and lib/handlers/publish.js performed no topic depth validation prior to emitting messages.
Furthermore, the vulnerability manifests across four distinct execution paths within the broker:
SUBSCRIBE Processing (lib/handlers/subscribe.js): Passing a subscription topic with > 100 levels passes validateTopic, invokes broker.subscribe(), and calls this.mq.on(topic, ...), which synchronously calls qlobber.add() and triggers the exception.PUBLISH Processing (lib/handlers/publish.js): Publishing a packet to a topic with > 100 levels invokes broker.publish(), which calls this.mq.emit(packet.topic, ...), triggering qlobber.match() and throwing the exception.UNSUBSCRIBE Processing (lib/handlers/unsubscribe.js): Unsubscribing from an over-limit topic passes validation and calls this.mq.removeListener(), invoking qlobber.remove() and throwing the exception.Will) Execution (lib/client.js / aedes.js): A client can specify a Will topic containing > 100 levels inside the initial CONNECT packet. The broker stores the Will object without triggering qlobber during handshake. When the client subsequently disconnects ungracefully (e.g., via a TCP RST), the client close handler invokes this.broker.publish(this.will, ...) directly, bypassing wire-level publish handlers and crashing the broker upon disconnect.The vulnerability was remediated in commit b9024faa4cb416c4c6980760b4d7f55336315f2d (released as version 1.1.1 via tag commit eac44f9920b49dd20eb0e83cc9d5c4b9038eb963). The patch addresses the flaw by introducing deterministic topic level counting, enforcing a configurable depth ceiling clamped at qlobber's limit of 100, and placing defensive guards at both the wire-protocol handler layer and the core broker API layer.
First, the maintainers introduced topicLevelCount and updated validateTopic in lib/utils.js. Rather than allocating an array via String.prototype.split('/')—which could itself introduce garbage collection pressure if an attacker sends a multi-megabyte string of slashes—topicLevelCount performs a linear O(n) character code scan for ASCII 47 (/):
// lib/utils.js (Patched in 1.1.1)
export function topicLevelCount (topic) {
if (typeof topic !== 'string') return 0
let levels = 1
for (let i = 0; i < topic.length; i++) {
// ASCII 47 is '/'
if (topic.charCodeAt(i) === 47) levels++
}
return levels
}
export function validateTopic (topic, message, maxTopicLevels = 100) {
if (!topic || topic.length === 0) {
return new Error('impossible to ' + message + ' to an empty topic')
}
if (topicLevelCount(topic) > maxTopicLevels) {
return new Error('topic has too many levels')
}
// ... existing wildcard and character validation ...
}Second, the Aedes constructor in aedes.js was updated to accept a maxTopicLevels configuration parameter. To ensure an administrator cannot misconfigure maxTopicLevels to a value greater than 100 (which would re-expose the qlobber exception), the constructor clamps the user-supplied value between 1 and MAX_TOPIC_LEVELS (100):
// aedes.js (Patched in 1.1.1)
const MAX_TOPIC_LEVELS = 100
// Inside Aedes constructor:
this.maxTopicLevels = Math.min(
Math.max(1, options.maxTopicLevels ?? MAX_TOPIC_LEVELS),
MAX_TOPIC_LEVELS
)Third, the wire handlers and core broker methods were updated to enforce this boundary before interacting with mqemitter or acknowledging packets. In lib/handlers/publish.js, the check is placed at the start of handlePublish so that over-limit topics are rejected before sending PUBACK (for QoS 1) or PUBREC (for QoS 2), and before writing messages to persistence:
// lib/handlers/publish.js (Patched in 1.1.1)
export function handlePublish (client, packet, done) {
if (topicLevelCount(packet.topic) > client.broker.maxTopicLevels) {
done(new Error('topic has too many levels'))
return
}
client.broker._series(
client,
publishActions,
packet,
done
)
}Finally, to close the Last Will and Testament (Will) attack path and protect programmatic calls to the broker instance, explicit level checks were added directly inside Aedes.prototype.publish, Aedes.prototype.subscribe, and Aedes.prototype.unsubscribe in aedes.js:
// aedes.js (Patched in 1.1.1)
Aedes.prototype.publish = function (packet, client, done) {
if (typeof client === 'function') {
done = client
client = null
}
if (topicLevelCount(packet.topic) > this.maxTopicLevels) {
if (done) done(new Error('topic has too many levels'))
return
}
// ... proceed with publish pipeline ...
}> [!NOTE]
> Fix Completeness Assessment: The patch in 1.1.1 is comprehensive. By enforcing the topicLevelCount check both at the wire handler entry points (handlePublish, handleSubscribe, handleUnsubscribe) and inside the core Aedes.prototype methods (publish, subscribe, unsubscribe), the fix prevents bypasses via delayed Will message execution as well as internal plugin calls. Additionally, clamping this.maxTopicLevels to a maximum of 100 ensures that qlobber's internal _max_words threshold cannot be reached even if an operator passes an invalid configuration option.
Exploiting CVE-2026-63341 requires network connectivity to the target Aedes listener (typically TCP port 1883 for standard MQTT, port 8883 for MQTTS, or an HTTP/WebSocket port for MQTT-over-WS). If the broker runs with its default authentication configuration—where broker.authenticate is not overridden to enforce credential checks—no authentication or prior privileges are required. If authentication is enabled, the attacker requires valid MQTT client credentials capable of sending CONNECT, PUBLISH, SUBSCRIBE, or UNSUBSCRIBE packets.
A functional proof-of-concept (PoC) repository demonstrating the vulnerability across affected entry points is publicly available at https://github.com/googlesky/CVE-2026-63341. An attacker can construct a single payload containing 101 or more topic levels (for example, 'a/'.repeat(100) + 'b', which totals 201 bytes and 101 levels) and transmit it immediately after completing the MQTT CONNECT / CONNACK handshake.
// Conceptual reproduction using the standard MQTT client library
import mqtt from 'mqtt'
const client = mqtt.connect('mqtt://target-broker:1883')
// 100 slashes produce 101 distinct topic levels, exceeding qlobber's max_words (100)
const maliciousTopic = 'a/'.repeat(100) + 'b'
client.on('connect', () => {
// Vector 1: Trigger via SUBSCRIBE
client.subscribe(maliciousTopic)
// Vector 2: Trigger via PUBLISH
// client.publish(maliciousTopic, 'payload')
})A stealthier exploitation variation leverages the MQTT Last Will and Testament (Will) mechanism during the initial CONNECT packet. When a client connects with a Will payload whose topic contains 101+ levels, the vulnerable broker accepts the connection without error because qlobber is not invoked during CONNECT parsing. The broker remains operational as long as the attacker holds the TCP socket open. As soon as the attacker drops the TCP connection without sending a clean MQTT DISCONNECT packet, the broker attempts to broadcast the stored Will topic via broker.publish(), triggering the uncaught exception and crashing the process on disconnect.
On a vulnerable Aedes instance (< 1.1.1), receiving any of these triggers produces the following stack trace and immediate process exit:
Error: too many words
at Qlobber._split_words (node_modules/qlobber/lib/qlobber.js:244:15)
at Qlobber.add (node_modules/qlobber/lib/qlobber.js:252:20)
at MQEmitter.on (node_modules/mqemitter/mqemitter.js:56:17)
at Aedes.subscribe (aedes.js:419:13)The primary security impact of CVE-2026-63341 is a complete Denial of Service (DoS) against the MQTT broker process. In IoT and industrial telemetry architectures, the MQTT broker acts as the central message bus coordinating state synchronization, command-and-control dispatches, and sensor ingestion across thousands of connected endpoints. When the Node.js process terminates unexpectedly, all active TCP and WebSocket client sessions are dropped simultaneously.
If the Node.js service is not managed by an automated process supervisor (such as systemd, PM2, or a Kubernetes pod restart policy), the broker remains offline until manual intervention occurs. Even when an automatic restart mechanism is present, an attacker can transmit the 201-byte MQTT packet in a continuous loop upon port recovery, placing the broker into a persistent crash loop (CrashLoopBackOff) and causing sustained service disruption.
Furthermore, abrupt process termination interrupts in-flight QoS 1 and QoS 2 message handshakes and prevents in-memory persistence stores (the default aedes-persistence backend) from flushing or preserving transient state, resulting in lost telemetry and unacknowledged command packets across dependent applications.
The vulnerability carries a CVSS v3.1 base score of 7.5 (High) (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H). The score reflects a Network attack vector (AV:N), Low attack complexity (AC:L), No privileges required (PR:N) under default broker settings, and High impact to Availability (A:H), with no direct impact on Confidentiality (C:N) or Integrity (I:N). As of current threat intelligence tracking, the vulnerability has an EPSS score of 0.00365 (31.08th percentile) and is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.
To remediate CVE-2026-63341, operators and developers must upgrade the aedes package to version 1.1.1 or later. Version 1.1.1 validates topic depth across all protocol handlers and internal broker methods, returning a handled protocol error to the client callback rather than allowing the topic to reach qlobber.
npm install aedes@>=1.1.1After upgrading to 1.1.1, developers can optionally tighten the maximum permitted topic depth below the default ceiling of 100 by specifying the maxTopicLevels option during broker instantiation to match their application's topic schema requirements:
import { Aedes } from 'aedes'
const broker = new Aedes({
// Restrict maximum topic hierarchy depth to 20 levels (clamped between 1 and 100)
maxTopicLevels: 20
})For environments where an immediate package upgrade is not feasible, operators can deploy an application-level workaround by implementing topic depth validation inside Aedes' built-in authorization hooks (authenticate, authorizePublish, and authorizeSubscribe). It is critical to inspect the client.will object inside the authenticate hook in addition to guarding authorizePublish and authorizeSubscribe; otherwise, an attacker can still crash the broker using the Last Will and Testament vector:
const MAX_LEVELS = 100
function hasExcessiveLevels (topic) {
if (typeof topic !== 'string') return false
let levels = 1
for (let i = 0; i < topic.length; i++) {
if (topic.charCodeAt(i) === 47) {
levels++
if (levels > MAX_LEVELS) return true
}
}
return false
}
// 1. Guard Will topics during CONNECT
broker.authenticate = function (client, username, password, callback) {
if (client.will && hasExcessiveLevels(client.will.topic)) {
const err = new Error('Will topic exceeds maximum allowed depth')
err.returnCode = 4 // MQTT Bad username or password / rejected
return callback(err, false)
}
callback(null, true)
}
// 2. Guard incoming PUBLISH packets
broker.authorizePublish = function (client, packet, callback) {
if (hasExcessiveLevels(packet.topic)) {
return callback(new Error('Publish topic exceeds maximum allowed depth'))
}
callback(null)
}
// 3. Guard incoming SUBSCRIBE packets
broker.authorizeSubscribe = function (client, sub, callback) {
if (hasExcessiveLevels(sub.topic)) {
return callback(new Error('Subscription topic exceeds maximum allowed depth'))
}
callback(null, sub)
}> [!WARNING]
> While the hook-based workaround above blocks CONNECT (with Will), PUBLISH, and SUBSCRIBE packets over the wire, Aedes does not provide an authorizeUnsubscribe hook prior to calling validateTopic and broker.unsubscribe. Therefore, upgrading to aedes@1.1.1 remains necessary to fully protect the UNSUBSCRIBE code path.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
aedes moscajs | < 1.1.1 | 1.1.1 |
| Attribute | Detail |
|---|---|
| CVE ID | CVE-2026-63341 (GHSA-xxqp-5qx8-gj5q) |
| Affected Component | moscajs/aedes (< 1.1.1) |
| Weakness Class | CWE-248 (Uncaught Exception) / CWE-400 (Uncontrolled Resource Consumption) |
| Attack Vector | Network (MQTT over TCP/TLS/WebSockets) |
| CVSS v3.1 Score | 7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) |
| EPSS Score | 0.36% (31.08th Percentile) |
| Impact | Unauthenticated Remote Denial of Service (Node.js Process Termination) |
| Exploit & KEV Status | Public PoC Available / Not Listed in CISA KEV |
An exception is thrown during program execution that is not caught by any exception handler, leading to abnormal process termination.
CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.
CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.
A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.
CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.
svglib versions prior to 2.3.1 contain an uncontrolled resource consumption vulnerability in the svg2rlg() renderer. When parsing SVG documents containing nested <use> elements, SvgRenderer.renderUse() recursively resolves and deep-copies referenced subtrees without enforcing a global expansion limit. Although the library detects and blocks direct circular references, an attacker can construct an acyclic directed reference graph with high fan-out (an SVG analogue to the XML Billion Laughs attack). Processing a crafted SVG payload of less than 2 KB triggers exponential node duplication, exhausting CPU and memory in applications that convert user-supplied SVGs or HTML documents embedding SVG content.
CVE-2026-132277 (also tracked as GHSA-q87h-c5m7-659j) is an uncontrolled resource consumption and algorithmic complexity vulnerability in the Inscriptis Python library (versions 2.0.0 through 2.7.5). When rendering sibling HTML table elements inside a block-level parent container, the parser fails to pop the parent block's inline padding prefix from the internal canvas prefix stack upon closing the block. Consequently, each subsequent sibling table inherits and accumulates the indentation prefixes of all preceding tables. This causes the output string length and memory allocation of get_text() to grow quadratically with the number of sibling tables, allowing a compact untrusted HTML payload to trigger denial of service via memory exhaustion.