# CVE-2026-58213: NATS Server: MQTT SUBSCRIBE Protocol Injection via Leaf Node/Route Forwarding allows arbitrary NATS command injection

- **Severity:** HIGH 7.1
- **CVSS:** 7.1 (v3.1, GitHub) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: Low; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, login needed
- **EPSS:** 0.44% (percentile 30, 2026-11-28)
- **CWE:** CWE-74
- **Aliases:** BIT-nats-2026-58213, GHSA-qrcv-3558-gj4f, GO-2026-7000
- **Published:** 2026-11-19T15:56:55.000Z
- **Modified:** 2026-11-23T20:41:34.329Z

## Who should check

- Projects that depend on Go package github.com/nats-io/nats-server/v2 (\< 2.12.9)

## Description

\#\#\# Background

NATS.io is a high performance open source pub-sub distributed communication technology, built for the cloud, on-premise, IoT and edge computing.

The NATS Server supports MQTT clients and can bridge MQTT activity into NATS subjects across routes and leafnode connections.

\#\#\# Problem Description

An MQTT client could include protocol control characters in subscription filters that were later forwarded as NATS protocol data to route or leafnode connections.

This 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.

Anonymous 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.

\#\#\# Affected Versions

Versions v2.14.0, v2.12.8 and below are vulnerable. The issue is fixed in v2.14.1 and v2.12.9.

\#\#\# Workarounds

Disable anonymous MQTT access where it is not required. Deployments that need MQTT have no known complete workaround other than upgrading.

\#\#\# References

 \* GHSA advisory: \<https://github.com/nats-io/nats-server/security/advisories/GHSA-qrcv-3558-gj4f\>
 \* Credit: @thesecguy45

## Affected and fixed versions

- Go `github.com/nats-io/nats-server/v2`: affected \< 2.12.9; fixed 2.12.9, 2.14.1 (ghsa)

## Technologies

Go modules

## Mitigation

- Upgrade github.com/nats-io/nats-server/v2 to one of 2.12.9, 2.14.1 (or later in the same release line).

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-58213. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-58213.md
Affected: github.com/nats-io/nats-server/v2 < 2.12.9
Fixed in: 2.12.9, 2.14.1

Steps:
1. Search this machine and project for github.com/nats-io/nats-server/v2 (Go): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-58213 being exploited?

There is no confirmed exploitation: CVE-2026-58213 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.44% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2026-58213?

High: CVSS 7.1 (v3.1, scored by GitHub). Remote, login needed.

### Which versions are affected by CVE-2026-58213?

github.com/nats-io/nats-server/v2 \< 2.12.9.

### Is there a fix for CVE-2026-58213?

Yes. Fixed in 2.12.9, 2.14.1. Upgrade github.com/nats-io/nats-server/v2 to one of 2.12.9, 2.14.1 (or later in the same release line).

### How do I check if I'm affected by CVE-2026-58213?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/nats-io/nats-server/security/advisories/GHSA-qrcv-3558-gj4f>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2026-58213>
- patch: <https://github.com/nats-io/nats-server/pull/8163>
- patch: <https://github.com/nats-io/nats-server/pull/8164>
- patch: <https://github.com/nats-io/nats-server/commit/366837cfc65ab9ccb4f98193c65e8daf238582d8>
- patch: <https://github.com/nats-io/nats-server/commit/64ebae40051ee497c481e10f316238faf0de1736>
- patch: <https://github.com/nats-io/nats-server/commit/f14856b9e57a36818f43851cb69b6e33670885c9>
- other: <https://github.com/nats-io/nats-server/releases/tag/v2.12.9>
- other: <https://github.com/nats-io/nats-server/releases/tag/v2.14.1>
- other: <https://github.com/advisories/GHSA-qrcv-3558-gj4f>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- GitHub Advisory Database: CC-BY 4.0 <https://github.com/advisories/GHSA-qrcv-3558-gj4f> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GO-2026-7000> (license: <https://creativecommons.org/licenses/by/4.0/>)
- FIRST EPSS: EPSS scores by FIRST <https://www.first.org/epss/>

HTML: <https://flawdb.com/CVE-2026-58213> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-58213>
