Injection Affecting github.com/nats-io/nats-server/v2/server package, versions <2.12.9>=2.14.0-RC.1 <2.14.1


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.44% (37th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GITHUBCOMNATSIONATSSERVERV2SERVER-17900809
  • published9 Jul 2026
  • disclosed8 Jul 2026
  • creditthesecguy45

Introduced: 8 Jul 2026

CVE-2026-58213  (opens in a new tab)
CWE-74  (opens in a new tab)

How to fix?

Upgrade github.com/nats-io/nats-server/v2/server to version 2.12.9, 2.14.1 or higher.

Overview

github.com/nats-io/nats-server/v2/server is an A simple, secure and performant communications system for digital systems, services and devices.

Affected versions of this package are vulnerable to Injection in the MQTT SUBSCRIBE handling, which forwards protocol control characters from subscription filters into the NATS protocol stream sent to route and leaf node connections. A user with MQTT client access can inject arbitrary NATS protocol operations across route, gateway, or leaf node connections, reaching other cluster nodes or accounts, by placing protocol control characters in an MQTT subscription filter. Exploitation requires MQTT to be enabled and the server to have route, gateway, or leaf node connections that forward the corrupted stream, with anonymous MQTT deployments at higher risk.

Workaround

The anonymous-client attack surface can be reduced by disabling anonymous MQTT access where it is not required, though authenticated MQTT clients can still trigger the injection.

CVSS Base Scores

version 4.0
version 3.1