HIGH 7.1

CVE-2026-58213: NATS Server MQTT Protocol Injection Vulnerability

NATS Server, a widely-used message broker for cloud and edge infrastructure, contains a protocol injection vulnerability in its MQTT connector. An authenticated MQTT client can embed special control characters in subscription filters that get forwarded unchanged into the NATS protocol stream sent to other servers in the cluster or leafnode connections. This corrupts the protocol state and allows an attacker to inject arbitrary NATS commands, potentially reading or manipulating messages intended for other applications. The flaw requires an authenticated MQTT connection but no special network access, making it a meaningful risk for deployments with untrusted or compromised MQTT clients.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.1 HIGH · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N
Weaknesses (CWE)
CWE-74
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.1 and 2.12.9, an MQTT client could include protocol control characters in subscription filters that were later forwarded as NATS protocol data to route or leafnode connections, corrupting the forwarded protocol stream and allowing injection of unintended NATS protocol operations. This issue is fixed in versions 2.14.1 and 2.12.9.

8 reference(s) · View on NVD →

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

Technical summary

CVE-2026-58213 is a protocol injection vulnerability in NATS Server versions prior to 2.14.1 and 2.12.9. When an MQTT client specifies a subscription filter containing NATS protocol control characters (such as newlines or spaces used as delimiters in the NATS wire protocol), the NATS Server does not sanitize or escape these characters before forwarding the filter to route and leafnode peer connections. Because NATS peers parse incoming data by delimiters, injected control characters break the protocol framing, causing subsequent data to be misinterpreted as new commands. An authenticated attacker can thus construct subscription requests that inject malformed NATS operations into the cluster's internal communication, leading to unintended message routing or command execution. The vulnerability is classified as CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component).

Business impact

In production deployments, this vulnerability allows a compromised or malicious MQTT client to break NATS cluster integrity without network-level access. An attacker with MQTT credentials can inject protocol commands that disrupt message routing, potentially causing data leakage across application boundaries or denial of service to dependent services. For organizations running multi-tenant NATS clusters or those with guest MQTT access, the impact escalates: a single compromised IoT device or edge client could inject commands affecting the entire cluster. Depending on downstream application logic, injected NATS operations might enable unauthorized message consumption or replay. Remediation is straightforward but requires coordinated patching across the cluster.

Affected systems

NATS Server versions 2.14.0 and earlier (up to 2.13.x in the 2.14 branch) and 2.12.8 and earlier in the 2.12 branch are affected. Any deployment exposing MQTT connectivity with active client connections is at risk. Vulnerable configurations include: NATS clusters with MQTT protocol enabled, leafnode deployments that accept MQTT traffic, and edge deployments where MQTT is the primary ingest mechanism. Systems not using MQTT listeners are not affected, nor are those running 2.14.1, 2.12.9, or later patched versions.

Exploitability

Exploitability requires a valid MQTT client credential, placing this in the authenticated-attacker threat model rather than unauthenticated remote code execution. However, MQTT deployments often run with permissive authentication (shared credentials, default passwords, or exposed brokers), making credential acquisition feasible in many real-world scenarios. Once authenticated, no network proxies or advanced exploitation techniques are needed; the attacker simply crafts a malicious subscription filter and the vulnerability is trivial to trigger. No user interaction or special timing is required. The CVSS score of 7.1 (HIGH) reflects high confidentiality impact (ability to read messages across tenant boundaries) and some integrity impact, but availability is not directly compromised unless injected commands cascade.

Remediation

Upgrade NATS Server to version 2.14.1 or later for the 2.14 line, or to version 2.12.9 or later for the 2.12 maintenance branch. Intermediate versions (2.13.x) should upgrade to 2.14.1. For clustered deployments, perform a rolling upgrade with one node at a time to avoid cluster coordination issues during the transition. After patching, monitor NATS logs for protocol errors or unexpected route/leafnode disconnections, which may indicate prior exploitation attempts. No configuration changes are required post-patch; the fix is in protocol input validation.

Patch guidance

Verify against the NATS Server release notes that version 2.14.1 or 2.12.9 is available for your platform (Linux, Windows, Docker, Kubernetes). If running NATS in Kubernetes, update the Helm chart or container image to a patched version; most official Helm repositories have backported the fix into maintenance releases. For Docker users, pull the latest image tag corresponding to 2.14.1 or 2.12.9. Perform the upgrade during a maintenance window or via rolling deployment to minimize downtime. Test MQTT and NATS protocol connectivity immediately after patching; a quick health check is to confirm cluster routes are stable and MQTT clients reconnect cleanly.

Detection guidance

Before patching, monitor NATS server logs for protocol parse errors, malformed NATS commands, or unexpected route/leafnode disconnections. Enable NATS debug logging (if operationally feasible) to capture malicious subscription filter payloads. Review MQTT client logs and audit trails for suspicious subscription patterns containing special characters (newlines, spaces in unusual positions) in filter names. Check cluster peer routes and leafnode connections for frequent reconnection events, which indicate protocol corruption. If you operate a multi-tenant NATS cluster, cross-tenant message leakage or unexpected routing may signal exploitation; correlate with MQTT client activity around the same time.

Why prioritize this

While this is a HIGH-severity vulnerability, it requires authenticated access and does not directly cause remote code execution or complete availability loss, which is why it does not reach CRITICAL. However, any organization with MQTT enabled and guest or shared credentials should prioritize patching immediately, as the attack surface is wide. Even air-gapped or private NATS deployments should patch within 30 days, as the ease of exploitation once authenticated makes this a preferred stepping stone for insider threats or compromised edge devices. The fact that it is not yet on the KEV (Known Exploited Vulnerabilities) catalog does not diminish urgency in MQTT-heavy architectures.

Risk score, explained

The CVSS 3.1 score of 7.1 (HIGH) is derived from the vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N. Attack Vector Network (AV:N) and low Attack Complexity (AC:L) reflect that any authenticated MQTT client can exploit this remotely without complex manipulation. Privileges Required (PR:L) accounts for the need for valid MQTT credentials. Scope Unchanged (S:U) means the impact is confined to the NATS service itself. Confidentiality impact is High due to potential message leakage across boundaries; Integrity is Low (protocol injection allows malformed commands but not data modification at rest); Availability is None (the service does not directly crash, though cascading impacts are possible).

Frequently asked questions

Do we need to patch if MQTT is disabled on our NATS servers?

No. This vulnerability only affects NATS Server instances that have the MQTT protocol listener enabled. If you are not using MQTT and all clients connect via the native NATS protocol, you are not at risk from this specific flaw. Verify by checking your NATS server config for any 'mqtt' listener block.

Will patching NATS Server require a full cluster restart?

A rolling upgrade is possible: upgrade and restart one server at a time while the cluster remains operational. However, test this in a staging environment first. Some organizations prefer a coordinated cluster-wide restart during a maintenance window for simplicity and to avoid potential protocol state inconsistencies during the transition.

Can this vulnerability be exploited by NATS clients that use the native NATS protocol, or only MQTT clients?

Only MQTT clients can directly trigger this vulnerability, because the flaw is in how NATS Server parses and forwards MQTT subscription filters. Native NATS protocol clients follow a different protocol syntax and do not supply subscription filters in the same way. However, once an MQTT client injects a malformed command into the cluster, it affects all downstream peers and leafnodes.

If we restrict MQTT client credentials, does that reduce our risk?

Yes, partially. Using strong, unique MQTT credentials and limiting MQTT access to trusted networks or applications reduces the likelihood of an attacker obtaining valid credentials. However, credential compromise or misuse by an insider remains a threat, so patching is still mandatory regardless of credential hygiene practices.

This analysis is provided for informational purposes and does not constitute professional security advice. Always verify vulnerability details and patch availability against official vendor advisories before making remediation decisions. Test patches in non-production environments first. The absence of a vulnerability from the CISA KEV catalog does not indicate lower risk or exploitability in your environment. Your organization's risk tolerance, NATS deployment topology, and MQTT usage patterns should inform your patching timeline and priority. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).