CVE-2026-30867: CocoaMQTT Denial of Service via Reachable Assertion in PUBLISH Packet Parsing

CocoaMQTT Updated 04 Apr 2026

Summary

03/04/2026
Yes i
Moderate
5.7

CVE-2026-30867: CocoaMQTT: Denial of Service via Reachable Assertion in PUBLISH Packet Parsing. Affects CocoaMQTT versions < 2.2.2. Fixed in 2.2.2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

CocoaMQTT is a Swift-based MQTT client library designed for iOS, macOS, and tvOS applications. It facilitates communication between devices using the MQTT protocol, which is lightweight and ideal for mobile and IoT applications. The library supports features such as message retention, quality of service levels, and secure connections. However, a vulnerability exists in its packet parsing logic that can lead to a denial of service (DoS) attack, impacting the stability of applications using this library.

Vulnerability Detail

A vulnerability in CocoaMQTT's packet parsing logic allows an attacker to crash the host application by sending a malformed PUBLISH packet. Specifically, when the Topic Length is set to zero, the library attempts to slice the byte array incorrectly, leading to an out-of-bounds access. This results in a runtime trap that crashes the application, effectively rendering it unusable until the retained message is removed from the broker. The vulnerability can be exploited by a malicious MQTT broker or an attacker publishing to a shared topic.

How To Fix

Minimum fixed version

2.2.2

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid subscribing to topics that may be controlled by untrusted sources or implement additional validation on incoming messages to filter out malformed packets.

Conclusion

The vulnerability CVE-2026-30867 in CocoaMQTT poses a significant risk of denial of service due to improper packet parsing. Users are advised to update to version 2.2.2 or later to mitigate this risk. Implementing workarounds and using tools like Vulert can help monitor and manage vulnerabilities effectively.

See every vulnerability recorded for CocoaMQTT →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 5.7, indicating a moderate severity level.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. By simply uploading your manifest file like package-lock.json, you can check for vulnerabilities in real-time.

Exploitation of this vulnerability can lead to a denial of service, causing the application to crash and become unusable until the retained message is cleared from the broker.

Yes, you can implement additional validation on incoming messages or avoid subscribing to untrusted topics as a temporary measure.

You can find more information about CocoaMQTT on its GitHub repository at https://github.com/emqx/CocoaMQTT.

How To Fix

Minimum fixed version

2.2.2

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback