/

CVE-2026-58253

Severity:

HIGH RISK

(8.8)

Auth Bypass (CWE-287) on NATS Inter-Server Connections

CVE-2026-58253

Analyzed

Vulnerability type

Category:

Authentication Bypass

CWE:

CWE-287

Impact:

Privilege Escalation and Unauthorized Access

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An authentication bypass in NATS Server allows unauthenticated peers to connect as trusted inter-server routes or leafnodes when no_auth_user is configured.

Under certain parser fast-path conditions, an attacker can bypass CONNECT authentication and gain privileges associated with internal server-to-server connections.

Affected context

This vulnerability arises in NATS Server deployments that configure no_auth_user and rely on authenticated route or leafnode listeners for inter-server connectivity.

In these setups, a parser optimization path intended for standard client connections can be mistakenly applied to inter-server listeners, weakening authentication checks.

The risk is most significant in environments where inter-server connections are highly trusted and granted broader messaging or administrative capabilities.

Exploit preconditions

  • Attack surface: Network-accessible NATS route or leafnode listener ports
  • Required access: Ability to establish a TCP connection to inter-server endpoints
  • Trigger point: Initiation of a CONNECT-like handshake where the fast-path parser skips normal authentication enforcement
  • Why exploitation is possible: The protocol parsing logic incorrectly reuses a client fast path for inter-server connections when no_auth_user is set, allowing unauthenticated peers to be treated as authenticated internal nodes

Why this happens

The core issue stems from flawed authentication enforcement in protocol parsing logic, mapped to CWE-287: Improper Authentication.

A performance-oriented parser fast path, designed for regular client connections, is accidentally applied to route and leafnode listeners when no_auth_user is configured.

As a result, the code path that should validate inter-server CONNECT credentials is bypassed, implicitly trusting connections that have not undergone proper authentication.

Potential impact

  • An unauthenticated actor may gain inter-server route or leafnode privileges.
  • An attacker could publish, subscribe, or relay messages as if part of the trusted NATS cluster.
  • Internal messaging integrity and confidentiality can be compromised.
  • Cluster topology or data flows could be manipulated by a rogue inter-server node.

General mitigation guidance

Effective mitigation focuses on hardening authentication boundaries and reducing implicit trust in inter-server connections.

Common patterns include:

  • Ensuring that authentication logic is consistently enforced for all listener types, avoiding special cases or fast paths that skip checks.
  • Treating inter-server connections as highly privileged and requiring strong, explicit credentials or mutual TLS.
  • Avoiding configurations that implicitly grant access (such as global no_auth_user) in environments with mixed client and inter-server endpoints.
  • Segmenting and restricting network access to route and leafnode ports, limiting exposure to untrusted peers.

How teams detect issues like this

High-level detection strategies may include:

  • Static analysis rules or manual code review focused on authentication entry points and protocol parsing paths, verifying that all listener types invoke the same enforcement logic.
  • Configuration audits that flag use of no_auth_user alongside exposed route or leafnode listeners.
  • Runtime logging and monitoring to identify unexpected inter-server connections or peers lacking expected authentication metadata.
  • Security policy checks in CI/CD that prevent the introduction of authentication shortcuts or fast paths that bypass verification.

Sources

SourceLink
github.comgithub.com/nats-io/nats-server/commit/7b81dd455ea95960090a84858c7662827948d1b6
github.comgithub.com/nats-io/nats-server/commit/8b8e1ad4ceed32321e00d4fc6e76be05bc13bca6
github.comgithub.com/nats-io/nats-server/commit/b86147e81710a52b72a7f7275f91d69f723f5cb3
github.comgithub.com/nats-io/nats-server/releases/tag/v2.11.16
github.comgithub.com/nats-io/nats-server/releases/tag/v2.12.7
github.comgithub.com/nats-io/nats-server/releases/tag/v2.14.0
github.comgithub.com/nats-io/nats-server/security/advisories/GHSA-38x3-76xf-cq45

Frequently asked

questions

Yes, if an attacker can reach the route or leafnode listener ports over the network, they can attempt to exploit the authentication bypass conditions.

The attacker needs only network-level access to inter-server endpoints; no valid NATS credentials are required when the vulnerable configuration and parser path are present.

The safest pattern is to enforce uniform, explicit authentication for all connection types, avoid implicit no_auth_user trust for inter-server listeners, and ensure protocol parsers cannot skip authentication checks via fast paths.

Prevention relies on consistent security design: treat performance optimizations as secondary to authentication integrity, centralize auth enforcement logic, regularly review configuration options that relax security, and integrate automated checks to flag risky authentication shortcuts in both code and deployment manifests.

Find out what's already
exploitable in your codebase.