CVE-2026-58213: NATS Server MQTT SUBSCRIBE Protocol Injection Vulnerability
HIGHCVE-2026-58213 is a HIGH (CVSS 7.1) mqtt subscribe protocol injection vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting NATS Server libraries in the Go ecosystem. The issue involves mqtt subscribe protocol injection via leaf node/route forwarding allows arbitrary nats command injection. Remediation is available by upgrading affected packages to version 2.12.9, 2.14.1.
CVE-2026-58213 at a Glance
Security Impact
CVSS: 7.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N).
How to Fix CVE-2026-58213
To remediate this vulnerability, upgrade all affected NATS Server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/nats-io/nats-server/v2 to 2.12.9
Upgrade github.com/nats-io/nats-server/v2 to 2.14.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/nats-io/nats-server/v2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-58213, inspect your project dependencies for NATS Server:
inspect dependencies for github.com/nats-io/nats-server/v2
Analyze the terminal output to locate any version of NATS Server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.12.9), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In NATS Server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-58213 Affected NATS Server Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/nats-io/nats-server/v2
|
Go |
< 2.12.9
|
2.12.9
|
|
github.com/nats-io/nats-server/v2
|
Go |
≥ 2.14.0-RC.1
< 2.14.1
|
2.14.1
|
References
Frequently Asked Questions
What is CVE-2026-58213?
Which NATS Server versions are affected?
What version fixes CVE-2026-58213?
Is github.com/nats-io/nats-server/v2 affected?
What is the CVSS score of CVE-2026-58213?
What CWE is associated with CVE-2026-58213?
How can I check Go dependencies for CVE-2026-58213?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qrcv-3558-gj4f",
"modified" : "2026-11-19T15:56:55Z",
"published" : "2026-11-19T15:56:55Z",
"aliases" : [ "CVE-2026-58213" ],
"summary" : "NATS Server: MQTT SUBSCRIBE Protocol Injection via Leaf Node/Route Forwarding allows arbitrary NATS command injection",
"details" : "### Background\n\nNATS.io is a high performance open source pub-sub distributed communication technology, built for the cloud, on-premise, IoT and edge computing.\n\nThe NATS Server supports MQTT clients and can bridge MQTT activity into NATS subjects across routes and leafnode connections.\n\n### Problem Description\n\nAn MQTT client could include protocol control characters in subscription filters that were later forwarded as NATS protocol data to route or leafnode connections.\n\nThis could corrupt the forwarded protocol stream and allow injection of unintended NATS protocol operations, potentially across cluster nodes or accounts where route or gateway connections are present.\n\nAnonymous MQTT deployments are higher risk because no credentials are required to reach the affected parser. Authenticated deployments are still affected for clients allowed to create MQTT subscriptions.\n\n### Affected Versions\n\nVersions v2.14.0, v2.12.8 and below are vulnerable. The issue is fixed in v2.14.1 and v2.12.9.\n\n### Workarounds\n\nDisable anonymous MQTT access where it is not required. Deployments that need MQTT have no known complete workaround other than upgrading.\n\n### References\n\n * GHSA advisory: <https://github.com/nats-io/nats-server/security/advisories/GHSA-qrcv-3558-gj4f>\n * Credit: @thesecguy45",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/nats-io/nats-server/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.12.9"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/nats-io/nats-server/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.14.0-RC.1"
}, {
"fixed" : "2.14.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/security/advisories/GHSA-qrcv-3558-gj4f"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-58213"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/pull/8163"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/pull/8164"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/commit/366837cfc65ab9ccb4f98193c65e8daf238582d8"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/commit/64ebae40051ee497c481e10f316238faf0de1736"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/commit/f14856b9e57a36818f43851cb69b6e33670885c9"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nats-io/nats-server"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/releases/tag/v2.12.9"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/releases/tag/v2.14.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-11-19T15:56:55Z",
"nvd_published_at" : "2026-07-08T20:16:54Z"
}
}