Authorization bypass in github.com/nats-io/nats-server/v2
Published 24 Oct 2023 · Updated 4 Feb 2026
Is your project on an affected github.com/nats-io/nats-server/v2?
Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- >=2.2.0 <2.9.23 · >=2.10.0 <2.10.2
- Fixed in
- 2.9.23, 2.10.2
go get github.com/nats-io/nats-server/v2@v2.10.2Details
Without any authorization rules in the nats-server, users can connect without authentication.
Before nats-server 2.2.0, all authentication and authorization rules for a nats-server lived in an "authorization" block, defining users. With nats-server 2.2.0 all users live inside accounts. When using the authorization block, whose syntax predates this, those users will be placed into the implicit global account, "$G". Users inside accounts go into the newer "accounts" block.
If an "accounts" block is defined, in simple deployment scenarios this is often used only to enable client access to the system account. When the only account added is the system account "$SYS", the nats-server would create an implicit user in "$G" and set it as the "no_auth_user" account, enabling the same "without authentication" logic as without any rules.
This preserved the ability to connect simply, and then add one authenticated login for system access.
But with an "authorization" block, this is wrong. Users exist in the global account, with login rules. And in simple testing, they might still connect fine without administrators seeing that authentication has been disabled.
In the fixed versions, using an "authorization" block will inhibit the implicit creation of a "$G" user and setting it as the "no_auth_user" target. In unfixed versions, just creating a second account, with no users, will also inhibit this behavior.
Is GO-2023-2133 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/nats-io/nats-server/v2, and gives you the command that fixes it.
More advisories for github.com/nats-io/nats-server/v2
- MediumCVE-2026-58208NATS Server: MQTT-over-WebSocket Path Can Crash WebSocket-Only JetStream Servers Before MQTT Is Enabled · 20 Nov 2026
- HighCVE-2026-58210NATS Server allows unauthenticated memory exhaustion through incomplete MQTT CONNECT packets · 20 Nov 2026
- MediumCVE-2026-58209NATS Server MQTT retained messages and QoS replay bypass subscription deny rules · 20 Nov 2026
- MediumCVE-2026-58214NATS Server MQTT subscribe permission bypass exposes internal QoS 2 metadata · 19 Nov 2026
- HighCVE-2026-58213NATS Server: MQTT SUBSCRIBE Protocol Injection via Leaf Node/Route Forwarding allows arbitrary NATS command injection · 19 Nov 2026
- LowCVE-2026-29785NATS Server panic via malicious compression on leafnode port in github.com/nats-io/nats-server · 26 Mar 2026
References
- Fixgithub.com/nats-io/nats-server/pull/4605
- Fixgithub.com/nats-io/nats-server/commit/fa5b7afcb64e7e887e49afdd032358802b5c4478
- Advisoryadvisories.nats.io/CVE/secnote-2023-01.txt
- Reportgithub.com/nats-io/nats-server/discussions/4535
- Linkgithub.com/nats-io/nats-server/releases/tag/v2.10.2
- Linkgithub.com/nats-io/nats-server/releases/tag/v2.9.23
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.