CVE-2026-85724
Moquette: Pattern-ACL wildcard injection (cross-tenant authorization bypass) plus a remote-unauthenticated DoS cluster, a Will-message authorization bypass, and a cross-session durable-corruption bug
Description
moquette is reachable by untrusted MQTT clients (anonymous by default), so every byte from any client, including pre-authentication, is untrusted. This is a memory-safe JVM: the ceiling is authorization/ACL bypass + denial of service + cross-session integrity, not RCE (I did not find one and do not claim one). Audited at commit da7f719a6bab9829d520b5838e13ea7b1f9be3ef, module broker/.
What a connecting client can do
- (Critical) Bypass
pattern-based ACLs across tenants. InAuthorizationsCollector.canDoOperation(AuthorizationsCollector.java:116-131, esp. line 123) the clientId/username is substituted raw into a pattern ACL rule and then wildcard-matched, and the clientId is never validated for MQTT wildcard characters +/# at CONNECT (MQTTConnection.processConnect):
Topic substitutedTopic = new Topic(auth.topic.toString().replace("%c", client).replace("%u", username)); if (topic.match(substitutedTopic)) return true;
A client that connects with clientId + turns sensor/%c/# into the filter sensor/+/#, gaining cross-tenant read AND write. (Precondition: pattern ACL rules configured — a common multi-tenant setup.)
(High) Crash the whole broker. SessionEventLoop (SessionEventLoop.java:40-54) catches only InterruptedException and is never restarted (SessionEventLoopGroup), so any uncaught exception on it wedges every co-located client. Trivially reachable inputs: malformed $share/grp SUBSCRIBE (SharedSubscriptionUtils.extractShareName -> StringIndexOutOfBoundsException), deeply nested topic (CTrie recursion -> StackOverflowError), and ACL NPE below. Unbounded subscriptions / retained / in-flight / topic-alias / interceptor state (BrokerInterceptor uses an unbounded queue) also allow OOM; durable stores allow disk exhaustion.
(High) NPE in ACL sink on clientId # (invalid filter sensor/#/# -> null tokens -> Topic.match NPE at Topic.java:173).
(High) Will-message authorization bypass. Last-Will topic is published (PostOffice.publishWill) without canWrite/reserved-topic checks used for normal PUBLISH.
(Medium) Cross-session durable corruption. H2PersistentQueue opens queue_"+clientId and queue_"+clientId+"_meta; client id sensor_meta collides with victim sensor metadata map -> corrupts head/tail.
(Medium) Fail-open if authenticator/authorizator class fails to load -> PermitAll/AcceptAll (Server.java:483-531).
Proof of concept
Source-only, no network; PoCs run on JDK 17:
- PoCPatternAcl — clientId + gains cross-tenant read/write; clientId # triggers NPE
- PoCSharedSubCrash — extractShareName("$share/grp") throws StringIndexOutOfBoundsException
- PoCMapCollision — H2 MVStore collision overwrites victim metadata pointer
Impact
Cross-tenant eavesdropping and injection, whole-broker DoS, unauthorized Will publishes, and cross-session durable corruption.
Remediation
- Reject clientId/username containing +/# (and / if structural) at CONNECT; expand %c/%u as literal tokens.
- Harden SessionEventLoop (catch Throwable + restart supervision) and validate $share filters.
- Apply authorization to Will publishes like normal PUBLISH.
- Add resource caps (connections, queues, retained, aliases, interceptor queue) + bounded session expiry.
- Separate H2 namespaces and fail closed on auth-class load failure.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| io.moquette » moquette-broker | < 0.18.1 | 0.18.1 |
Blast radius
53% of the dependent artifacts (35) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 293 |
| 2 hops | 391 |
| 3 hops | 63 |
| 4 hops | 37 |
| 5 hops | 57 |
Most used dependents
- org.apache.iotdb » iotdb-server23 usages
- org.wso2.extension.siddhi.io.mqtt » siddhi-io-mqtt7 usages
- org.wso2.carbon.analytics » org.wso2.carbon.das.jobmanager.core.feature5 usages
- org.eclipse.digitaltwin.basyx » basyx.aasenvironment-core5 usages
- de.fraunhofer.iosb.ilt.FROST-Server » FROST-Server.MQTT.Moquette4 usages
- org.eclipse.digitaltwin.basyx » basyx.mqttcore4 usages
- org.apache.iotdb » iotdb-cli4 usages
- org.eclipse.digitaltwin.basyx » basyx.aasenvironment-http3 usages
- org.geckoprojects.messaging » org.gecko.moquette.broker3 usages
- org.wso2.carbon.analytics » org.wso2.carbon.das.jobmanager.core2 usages
- org.eclipse.digitaltwin.basyx » basyx.aasenvironment-feature-authorization2 usages
- org.eclipse.ecsp » ro-entities2 usages
- org.apache.iotdb » iotdb-confignode2 usages
- org.apache.iotdb » iotdb-cluster2 usages
- de.fraunhofer.iosb.ilt.FROST-Server » FROST-Server.MQTT1 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
| Advisory | NVD CVE-2026-85724 | nvd.nist.gov |
| Package | moquette-io/moquette | github.com |
| Web | moquette-io/moquette advisory GHSA-5f42-97gr-vfhq | github.com |
| Web | moquette-io/moquette pull request #959 | github.com |
| Web | moquette-io/moquette pull request #958 | github.com |
| Web | moquette-io/moquette pull request #957 | github.com |
| Web | moquette-io/moquette commit f5a323f | github.com |
| Web | moquette-io/moquette commit d777535 | github.com |
| Web | moquette-io/moquette commit ca17e0b | github.com |
| Web | moquette-io/moquette commit c65b3e9 | github.com |
| Web | moquette-io/moquette commit b4a98bb | github.com |
| Web | moquette-io/moquette commit affdc71 | github.com |
| Web | moquette-io/moquette commit 86feb7c | github.com |
| Web | moquette-io/moquette commit 72d6c82 | github.com |
| Web | moquette-io/moquette commit 2649863 | github.com |
| Web | moquette-io/moquette commit 14a2f4f | github.com |
| Web | moquette-io/moquette release v0.18.1 | github.com |
