{"id":"CVE-2026-95847","aliases":["CVE-2026-95847","GHSA-5f42-97gr-vfhq"],"related":["CVE-2026-85724","CVE-2026-95842","CVE-2026-95843","CVE-2026-95844","CVE-2026-95845","CVE-2026-95846","CVE-2026-95848"],"kind":"vulnerability","state":"published","title":"Moquette client IDs can cause cross-session H2 durable-queue corruption","summary":"Moquette is a lightweight Java MQTT broker. Prior to 0.18.1, H2PersistentQueue derives a session's message-map name as queue_ plus the client ID and its metadata-map name as queue_ plus the client ID plus _meta. A durable session whose client ID ends in _meta can therefore make its message map collide with another client's metadata map. The colliding sessions read and write the same H2 MVStore map with incompatible value types, which can corrupt queue head and tail data and cause message loss, misdelivery, failed queue reloads, or exposure of queued content across sessions. This issue is fixed in version 0.18.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Moquette is a lightweight Java MQTT broker. Prior to 0.18.1, H2PersistentQueue derives a session's message-map name as queue_ plus the client ID and its metadata-map name as queue_ plus the client ID plus _meta. A durable session whose client ID ends in _meta can therefore make its message map collide with another client's metadata map. The colliding sessions read and write the same H2 MVStore map with incompatible value types, which can corrupt queue head and tail data and cause message loss, misdelivery, failed queue reloads, or exposure of queued content across sessions. This issue is fixed in version 0.18.1.","source":"cvelist"},{"lang":"en","text":"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/`.\n\n## What a connecting client can do\n\n1. (Critical) Bypass `pattern`-based ACLs across tenants. In `AuthorizationsCollector.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):\n\nTopic substitutedTopic = new Topic(auth.topic.toString().replace(\"%c\", client).replace(\"%u\", username));\nif (topic.match(substitutedTopic)) return true;\n\nA 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.)\n\n2. (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.\n\n3. (High) NPE in ACL sink on clientId # (invalid filter sensor/#/# -> null tokens -> Topic.match NPE at Topic.java:173).\n\n4. (High) Will-message authorization bypass. Last-Will topic is published (PostOffice.publishWill) without canWrite/reserved-topic checks used for normal PUBLISH.\n\n5. (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.\n\n6. (Medium) Fail-open if authenticator/authorizator class fails to load -> PermitAll/AcceptAll (Server.java:483-531).\n\n## Proof of concept\n\nSource-only, no network; PoCs run on JDK 17:\n- PoCPatternAcl — clientId + gains cross-tenant read/write; clientId # triggers NPE\n- PoCSharedSubCrash — extractShareName(\"$share/grp\") throws StringIndexOutOfBoundsException\n- PoCMapCollision — H2 MVStore collision overwrites victim metadata pointer\n\n## Impact\n\nCross-tenant eavesdropping and injection, whole-broker DoS, unauthorized Will publishes, and cross-session durable corruption.\n\n## Remediation\n\n1. Reject clientId/username containing +/# (and / if structural) at CONNECT; expand %c/%u as literal tokens.\n2. Harden SessionEventLoop (catch Throwable + restart supervision) and validate $share filters.\n3. Apply authorization to Will publishes like normal PUBLISH.\n4. Add resource caps (connections, queues, retained, aliases, interceptor queue) + bounded session expiry.\n5. Separate H2 namespaces and fail closed on auth-class load failure.","format":"markdown","source":"ghsa"}],"published":"2026-09-23T16:11:18.000Z","modified":"2026-10-19T19:30:12.063Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N","score":8.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N","score":9.6,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-99","CWE-155","CWE-863"],"affected":[{"ranges":[{"version":"< 0.18.1","status":"affected"}],"vendor":"moquette-io","product":"moquette","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.18.1"}],"ecosystem":"Maven","package":"io.moquette:moquette-broker","purl":"pkg:maven/io.moquette/moquette-broker","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.18.1"}],"vendor":"moquette","product":"moquette","cpe":"cpe:2.3:a:moquette:moquette:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/moquette-io/moquette/security/advisories/GHSA-5f42-97gr-vfhq","tags":["exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/moquette-io/moquette/pull/964","tags":["patch","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/moquette-io/moquette/commit/72d6c8257191d2e4b2e3aa11ab25fd09f88c6cb7","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/moquette-io/moquette/releases/tag/v0.18.1","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-85724","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/moquette-io/moquette/pull/959","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/moquette-io/moquette/pull/958","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/moquette-io/moquette/pull/957","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/moquette-io/moquette/commit/f5a323fe782d1505c0097498cb22eb6ec6c96973","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/moquette-io/moquette/commit/d77753542e262b7aa573dee3c2b05e44439bbd96","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/moquette-io/moquette/commit/ca17e0be19e86d5e291f4532dfdc94616c8e0049","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/moquette-io/moquette/commit/c65b3e90fa03e562e2c2fa69c3ee916c2cbfbd2b","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/moquette-io/moquette/commit/b4a98bb3f3425ece476ed073aa080c627c1239af","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/moquette-io/moquette/commit/affdc71fdba92dc020421678970ae70518fb6da2","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/moquette-io/moquette/commit/86feb7c31e6fac849c465d8079d08c0e7ef01cdf","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/moquette-io/moquette/commit/26498631e92d50440b4e3ed42fa546253cc4090c","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/moquette-io/moquette/commit/14a2f4fd280c8f6a791600c306cbccecb7c67007","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/moquette-io/moquette","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-09-23T16:50:06.329Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-95847","url":"https://www.cve.org/CVERecord?id=CVE-2026-95847","licence":"CVE Terms of Use","modified":"2026-09-23T16:50:25.152Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5f42-97gr-vfhq","url":"https://github.com/advisories/GHSA-5f42-97gr-vfhq","licence":"CC-BY-4.0","modified":"2026-10-19T19:30:12.063Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-95847","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-95847","licence":"Public domain","modified":"2026-09-28T15:23:24.197Z"}],"updatedAt":"2026-11-25T22:59:40.644Z","epss":{"score":0.00341,"percentile":0.29575,"date":"2026-12-01T12:00:22.000Z"}}