Memory Allocation Vulnerability in Mosquitto: CVE-2023-0809

mosquitto Updated 02 Oct 2025

Summary

02/10/2023
N/A
Yes i
Medium
5.3

ALPINE-CVE-2023-0809: In Mosquitto before 2.0.16, excessive memory is allocated based on malicious initial packets that are not CONNECT packets. Affects mosquitto versions < 2.0.16-r0. Fixed in 2.0.16-r0. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Mosquitto is an open-source message broker that implements the MQTT protocol, widely used for IoT applications. It facilitates lightweight messaging between devices, making it ideal for low-bandwidth, high-latency networks. The package is known for its efficiency and scalability, but it has recently been identified to have a vulnerability that can lead to excessive memory allocation based on malicious input.

Vulnerability Detail

In Mosquitto versions prior to 2.0.16, a vulnerability exists where excessive memory is allocated when the broker receives initial packets that are not CONNECT packets. This can be exploited by attackers to cause denial of service by exhausting memory resources, potentially leading to application crashes or degraded performance. The vulnerability is classified under CVE-2023-0809 and has a CVSS score of 5.3, indicating a moderate severity level.

How To Fix

Minimum fixed version

2.0.16-r0

This is the first release that contains the fix.

sudo apk add --upgrade mosquitto

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

Workaround

As a temporary measure, you can implement input validation to ensure that only valid CONNECT packets are processed by the Mosquitto broker, thereby mitigating the risk of memory exhaustion from malicious packets.

Conclusion

The Mosquitto vulnerability identified as CVE-2023-0809 poses a significant risk due to excessive memory allocation from malicious packets. It is crucial to update to version 2.0.16-r0 or later to mitigate this risk. Implementing input validation can serve as a temporary workaround while ensuring the reliability of your messaging system.

See every vulnerability recorded for mosquitto →

Share this vulnerability

FAQ

CVE-2023-0809 is a vulnerability in Mosquitto that allows excessive memory allocation based on malicious initial packets, potentially leading to denial of service.

You can check your Mosquitto version and compare it with the patched version 2.0.16-r0. Additionally, you can use the Vulert playground to monitor for vulnerabilities.

Failure to address this vulnerability may result in application crashes or degraded performance due to memory exhaustion, impacting the reliability of your messaging system.

Yes, implementing input validation to restrict the types of packets processed can serve as a temporary workaround until the update is applied.

Vulert is a tool that monitors and alerts for open-source vulnerabilities in your software using a manifest file. You can check for vulnerabilities in your application without requiring installation or signup.

Related vulnerabilities

Recent vulnerabilities recorded for mosquitto.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.0.16-r0

This is the first release that contains the fix.

sudo apk add --upgrade mosquitto

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