HIGH 7.5

CVE-2026-58210: NATS Server MQTT Memory Exhaustion – Denial of Service Vulnerability

NATS Server, a widely-used messaging platform for cloud and edge infrastructure, has a vulnerability that allows unauthenticated attackers to trigger a memory exhaustion condition. An attacker can connect to the MQTT interface without credentials and send incomplete connection packets that claim a very large size. The server will hold these packets in memory while waiting for the remainder of the data to arrive, but the attacker never sends it. By opening multiple such connections, an attacker can exhaust the server's available memory, causing the service to become unavailable. This affects NATS Server versions before 2.14.3 and 2.12.12.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weaknesses (CWE)
CWE-400
Affected products
1 configuration(s)
Published / Modified
2026-07-08 / 2026-07-13

NVD description (verbatim)

NATS Server is a high-performance server for NATS.io, the cloud and edge native messaging system. Prior to 2.14.3 and 2.12.12, an unauthenticated MQTT client could cause the server to retain large incomplete MQTT CONNECT packets before authentication completed, consuming server memory while the parser waited for the advertised MQTT packet length. This issue is fixed in versions 2.14.3 and 2.12.12.

5 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability stems from improper handling of incomplete MQTT CONNECT frames in NATS Server's MQTT parser. When an MQTT client initiates a connection, it must send a CONNECT packet with a declared payload length. The vulnerable code allocates memory to buffer the incoming payload before validating the packet completeness or the client's credentials. An unauthenticated attacker can craft a CONNECT packet with an extremely large length field (up to the protocol maximum) but never send the actual payload data. The server retains this incomplete packet in memory, waiting for additional bytes. Repeated exploitation allows an attacker to accumulate large amounts of unfreeable memory, eventually exhausting heap resources and triggering an out-of-memory condition that crashes or hangs the service. The issue occurs because authentication is performed after full packet assembly, not before buffer allocation.

Business impact

Organizations relying on NATS Server for message-driven applications, microservices orchestration, or edge computing face potential service disruptions. A successful attack requires no credentials and no sophisticated tooling, making it accessible to any network-adjacent attacker. The resulting denial of service can cascade through dependent systems: IoT data pipelines, cloud-native CI/CD workflows, and event-streaming infrastructure may all degrade or fail if the NATS broker becomes unavailable. Recovery requires manual intervention to restart the server, during which message delivery is halted. This is particularly critical for customers using NATS in production environments where high availability is expected.

Affected systems

NATS Server versions prior to 2.14.3 (affecting 2.14.0–2.14.2) and prior to 2.12.12 (affecting all 2.12.x versions before 2.12.12) are vulnerable. The MQTT protocol handler is enabled by default in standard NATS deployments, so systems are at risk unless MQTT is explicitly disabled. The vulnerability requires network access to the MQTT port (typically 1883 or a configured alternative); it does not require NATS protocol access or any form of authentication. Environments that expose the NATS MQTT interface to untrusted networks (including the public internet) face the highest immediate risk.

Exploitability

Exploitability is very high. No authentication credentials are required, and the attack vector is entirely network-based with no user interaction needed. A simple script can open multiple MQTT connections and send oversized CONNECT packets; existing MQTT client libraries do not need modification. The attack is reliable—any incomplete packet with a sufficiently large declared length will trigger memory retention. Detection by intrusion detection systems is possible but not trivial, since the traffic appears to be malformed but legitimate MQTT. An attacker needs only basic network access to the MQTT port and knowledge of the MQTT framing format (widely documented). The practical barrier to exploitation is extremely low.

Remediation

Apply vendor patches immediately: upgrade to NATS Server 2.14.3 or later for the 2.14.x branch, or to 2.12.12 or later for the 2.12.x branch. These versions fix the parser to validate packet completeness and limit buffer allocation before authentication. Users unable to patch immediately should: (1) restrict network access to the NATS MQTT interface using firewalls or network segmentation, allowing connections only from trusted clients; (2) disable MQTT protocol support if it is not required; (3) monitor memory usage and server responsiveness for signs of attack; (4) implement rate limiting on connection attempts if the NATS deployment supports such controls. Patching is the only permanent solution and should be prioritized given the ease of exploitation.

Patch guidance

NATS Server patches are available in versions 2.14.3 and 2.12.12. Consult the official NATS release notes at github.com/nats-io/nats-server/releases to confirm availability for your deployment model (binary, container image, package manager). Test patches in a staging environment first, especially if you run NATS in a mission-critical data path. The patches modify the MQTT frame parser and should be backward compatible; no configuration changes are required to gain protection. Plan the upgrade during a maintenance window, as restarting NATS will briefly interrupt message flow. If you are on a different major version (e.g., 2.11.x or earlier), consult the vendor advisory to determine the appropriate upgrade path.

Detection guidance

Monitor NATS Server memory usage and look for unusual spikes that correlate with MQTT connection activity. Enable debug logging on the MQTT handler if available; you may observe warnings about incomplete packets or buffer allocation failures. Network-level detection: inspect traffic to the MQTT port for CONNECT frames followed by prolonged inactivity without sending further data, or repeated connections from a single source that never complete authentication. Look for patterns of short-lived connections that accumulate without graceful closure. NATS Server metrics (if exposed via Prometheus or similar) should be queried for growth in the number of unauthenticated connections. A sudden spike in half-open MQTT connections is a strong indicator of an active attack.

Why prioritize this

This vulnerability rates HIGH due to a combination of factors: zero authentication required, trivial exploitability, high-impact denial of service, and default exposure of MQTT in standard deployments. The CVSS 3.1 score of 7.5 reflects availability impact without credential or user interaction requirements. Organizations should prioritize patching within their normal security update cycles, ideally within 1–2 weeks. However, immediate network-level mitigations (restricting MQTT access) are feasible and strongly recommended for environments that cannot patch immediately.

Risk score, explained

The CVSS 3.1 base score of 7.5 (HIGH) is derived from: AV:N (network-based attack vector), AC:L (low attack complexity—no special conditions required), PR:N (no privilege required), UI:N (no user interaction), S:U (scope unchanged), C:N (no confidentiality impact), I:N (no integrity impact), A:H (high availability impact via denial of service). The high severity reflects the practical threat: an unauthenticated attacker can reliably crash or hang a critical infrastructure component with minimal effort and no prior knowledge of the target system's configuration.

Frequently asked questions

Can this vulnerability be exploited if MQTT is disabled on my NATS Server?

No. If you have explicitly disabled MQTT protocol support in your NATS configuration, you are not at risk from this vulnerability. The vulnerability is specific to the MQTT frame parser, which is not invoked if MQTT is not enabled. Verify your configuration file for the 'mqtt' stanza; if it is absent or set to false, MQTT is disabled and you are not vulnerable.

Does this affect NATS clients that use the core NATS protocol rather than MQTT?

No. This vulnerability affects only unauthenticated MQTT clients connecting to the MQTT interface. Clients using the standard NATS protocol (nats://) are unaffected, as they follow a different handshake and authentication flow that does not have this buffer allocation issue.

If I can only patch during a specific maintenance window weeks away, what should I do now?

Implement immediate network-level controls: restrict access to the MQTT port (typically 1883) using a firewall, allowing connections only from known, trusted sources. If MQTT is not in active use, disable it entirely in your NATS configuration. These measures will block the attack vector while you prepare for patching. Also enable monitoring and alerting on memory usage and connection counts so you can detect any exploitation attempts before they cause an outage.

Are there any workarounds that allow me to keep MQTT fully open while waiting for a patch?

No reliable workaround exists that maintains full MQTT availability without patching. The only effective long-term solution is to upgrade to a patched version. However, you can deploy a reverse proxy or load balancer in front of NATS that enforces connection timeouts or maximum payload sizes to reduce (but not eliminate) the attack surface while you prepare to patch.

This analysis is provided for informational and educational purposes to help security teams understand and respond to CVE-2026-58210. It is not a substitute for official vendor advisories or security bulletins. Always verify patch availability and compatibility against the official NATS project release notes (github.com/nats-io/nats-server) before deploying updates. Testing in a non-production environment is strongly recommended. The vulnerability details and patch information are current as of the date published; refer to official sources for any updates or corrections. SEC.co assumes no liability for actions taken based on this analysis. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).