CVE-2026-58213: NATS Server: MQTT SUBSCRIBE Protocol Injection via Leaf Node/Route Forwarding allows arbitrary NATS command injection
Published 2026-11-19 · Updated 2026-11-23 · Also known as BIT-nats-2026-58213, GHSA-qrcv-3558-gj4f, GO-2026-7000
Summary
A protocol injection vulnerability in NATS Server allows MQTT clients to inject arbitrary NATS protocol operations by including control characters in MQTT subscription filters. Engineering and operations teams maintaining NATS Server instances with MQTT enabled should upgrade to a fixed version immediately.
Who is affected
Affected deployments are those running NATS Server with MQTT enabled, particularly where route or leafnode connections bridge MQTT activity across cluster nodes or accounts. Anonymous MQTT deployments carry the highest risk since no credentials are required, though authenticated deployments remain vulnerable to any client authorized to create MQTT subscriptions. Exploitation can corrupt forwarded protocol streams and trigger unintended operations across cluster nodes or accounts.
Exploitability
The vulnerability is network accessible with low attack complexity, requiring low privileges and no user interaction, giving it a CVSS 3.1 base score of 7.1 (High). EPSS estimates the probability of exploitation at 0.004 (0.391 percentile), and it is not currently listed in CISA's Known Exploited Vulnerabilities catalog.
Remediation
- Upgrade github.com/nats-io/nats-server/v2 to version 2.12.9 (for the 2.12.x branch) or version 2.14.1 (for the 2.14.x branch).
- Disable anonymous MQTT access in server configurations where it is not required to mitigate unauthenticated exploitation.
How to check your project
- Check Go dependency manifests or running binaries for github.com/nats-io/nats-server/v2 versions 2.12.8 and below, or version 2.14.0.
- Inspect NATS Server configuration files to verify whether MQTT listener services are active and exposed.
Automated analysis of the published advisory data, generated 2026-11-23. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| Go | github.com/nats-io/nats-server/v2 |
>= 0, < 2.12.9 | 2.12.9 | go get github.com/nats-io/nats-server/[email protected] |
| Go | github.com/nats-io/nats-server/v2 |
>= 2.14.0-RC.1, < 2.14.1 | 2.14.1 | go get github.com/nats-io/nats-server/[email protected] |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N
| Attack vector | Network |
|---|---|
| Attack complexity | Low |
| Privileges required | Low |
| User interaction | None |
| Scope | Unchanged |
| Confidentiality | High |
| Integrity | Low |
| Availability | None |
FAQ
What causes this vulnerability in NATS Server?
The server fails to filter protocol control characters present in MQTT subscription filters before forwarding them as NATS protocol data across route or leafnode connections.
Is CVE-2026-58213 actively exploited in the wild?
No, according to the provided CISA Known Exploited Vulnerabilities status, there is no documented active exploitation.
Is there a complete workaround available without upgrading?
No. While disabling anonymous MQTT access reduces risk for unauthenticated vectors, deployments that require MQTT have no known complete workaround other than upgrading to fixed versions.
Original advisory description
References
- WEB https://github.com/nats-io/nats-server/security/advisories/GHSA-qrcv-3558-gj4f
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-58213
- WEB https://github.com/nats-io/nats-server/pull/8163
- WEB https://github.com/nats-io/nats-server/pull/8164
- WEB https://github.com/nats-io/nats-server/commit/366837cfc65ab9ccb4f98193c65e8daf238582d8
- WEB https://github.com/nats-io/nats-server/commit/64ebae40051ee497c481e10f316238faf0de1736
- WEB https://github.com/nats-io/nats-server/commit/f14856b9e57a36818f43851cb69b6e33670885c9
- PACKAGE https://github.com/nats-io/nats-server
- WEB https://github.com/nats-io/nats-server/releases/tag/v2.12.9
- WEB https://github.com/nats-io/nats-server/releases/tag/v2.14.1
Source records: GHSA-qrcv-3558-gj4f, GO-2026-7000 (OSV.dev) · EPSS by FIRST, 2026-11-23.