/

CVE-2026-130491

Severity:

HIGH RISK

(7.5)

Uninitialized Memory (CWE-908) in Eclipse libmosquitto

CVE-2026-130491

Received

Vulnerability type

Category:

Uninitialized Memory Disclosure

CWE:

CWE-200, CWE-908

Impact:

Exposure of uninitialized process memory through an MQTT Will message

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

In affected libmosquitto versions, the Will-setting functions do not reject payloads larger than 65,535 bytes. When an oversized payload is supplied, uninitialized heap memory may be included in the Will and transmitted when it is published.

Affected context

The issue occurs in Eclipse's libmosquitto client library when an application calls mosquitto_will_set() or mosquitto_will_set_v5() with a Will payload exceeding 65,535 bytes. Risk depends on whether an application can supply or construct an oversized payload and whether the resulting Will is published to recipients.

Exploit preconditions

  • Attack surface: Applications using libmosquitto's Will-setting functions
  • Required access: Ability to influence the Will payload, or to cause the application to use an oversized payload
  • Trigger point: Setting the Will with a payload longer than 65,535 bytes, followed by publication of the Will
  • Why exploitation is possible: The library does not reject the oversized payload, which can result in uninitialized heap bytes being transmitted

Why this happens

The library accepts a payload length beyond the supported 65,535-byte limit without rejecting it. As a result, uninitialized heap memory may be included in data transmitted as the Will. This is an uninitialized resource issue, CWE-908, with potential information disclosure consequences associated with CWE-200.

Potential impact

  • Uninitialized heap data may be disclosed to MQTT subscribers
  • Sensitive information present in process memory could be exposed
  • Applications and services receiving the Will could be affected by unexpected message contents

General mitigation guidance

Defensive patterns include validating Will payload lengths before passing them to the library and enforcing a maximum of 65,535 bytes. Prefer APIs and wrappers that reject out-of-range values by default, and initialize buffers before use. Reduce trust in externally supplied payloads through input limits and validation, and apply least-privilege controls to limit the consequences of any unintended data exposure.

How teams detect issues like this

Review call sites for mosquitto_will_set() and mosquitto_will_set_v5() and check whether payload lengths are bounded before use. Static analysis can flag unchecked lengths passed to these functions and paths where externally influenced data reaches Will configuration. Policy checks can require explicit length validation and tests for boundary and oversized inputs; automated code review tools may help identify these patterns.

Sources

SourceLink
github.comgithub.com/eclipse-mosquitto/mosquitto/security/advisories/GHSA-6hx2-p6j3-qrjg
gitlab.eclipse.orggitlab.eclipse.org/security/cve-assignment/-/work_items/593
openwall.comopenwall.com/lists/oss-security/2026/11/17/20

Frequently asked

questions

The issue is triggered through libmosquitto API calls. Remote influence may be possible if an application accepts payload data from a remote source, but the description does not establish direct remote exploitation.

An attacker would need a way to influence the Will payload or cause the application to configure an oversized payload. The Will must then be published for its contents to be transmitted.

Reject payloads longer than 65,535 bytes before calling the Will-setting functions, and ensure buffers are initialized before their contents can be transmitted.

Apply strict input-length limits at trust boundaries, validate lengths at API call sites, and use static analysis and tests to detect unchecked size handling.

Find out what's already
exploitable in your codebase.