CVE-2026-58254: Github.com/nats io/nats server/v2 Nats-server Leaf Node Connections Bypass Vulnerability

MODERATE
Advisory Identifier: GHSA-p3j5-5hrq-p75h
CVSS 6.5
CWE-863
Published
Advisory Summary

CVE-2026-58254 is a MODERATE (CVSS 6.5) nats-server leaf node connections bypass vulnerability (CWE-863: Incorrect Authorization) affecting Github.com/nats io/nats server/v2 libraries in the Go ecosystem. The issue involves nats-server leaf node connections bypass nats-trace-dest permission check. Remediation is available by upgrading affected packages to version 2.12.8, 2.14.3.

CVE-2026-58254 at a Glance

CVE Identifier CVE-2026-58254
GHSA Identifier GHSA-p3j5-5hrq-p75h
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-863: Incorrect Authorization
Affected Product Github.com/nats io/nats server/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-58254

To remediate this vulnerability, upgrade all affected Github.com/nats io/nats server/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/nats-io/nats-server/v2 fixed: 2.12.8
Upgrade github.com/nats-io/nats-server/v2 to 2.12.8
github.com/nats-io/nats-server/v2 fixed: 2.14.3
Upgrade github.com/nats-io/nats-server/v2 to 2.14.3
Verify Direct and Transitive Dependencies

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-58254, inspect your project dependencies for Github.com/nats io/nats server/v2:

inspect dependencies for github.com/nats-io/nats-server/v2

Analyze the terminal output to locate any version of Github.com/nats io/nats server/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.12.8), 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-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Github.com/nats io/nats server/v2, 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

### 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 leafnode connections between servers and message tracing through NATS headers. ### Problem Description Message trace destination checks were applied to ordinary client connections but not consistently to messages arriving through leafnode connections. A leafnode operator could cause trace events to be sent to subjects that would not otherwise be permitted and could use trace-only behavior to prevent normal delivery or storage of affected messages. Trace events can include routing, subscription, account, service import and JetStream metadata. The payload of the original application message is not chosen through the trace event itself. ### Affected Versions Versions v2.14.2, v2.12.7 and below are vulnerable. The issue is fixed in v2.14.3 and v2.12.8. ### Workarounds Where possible, avoid granting publish paths from less-trusted leaf nodes into subjects for which trace-only behavior would affect delivery guarantees. No other known workarounds are available aside from upgrading to a fixed release. ### References * GHSA advisory: <https://github.com/nats-io/nats-server/security/advisories/GHSA-p3j5-5hrq-p75h> * Credit: Koda Reef

CVE-2026-58254 Affected Github.com/nats io/nats server/v2 Versions

2 component(s)
Fixed Versions:
2.12.82.14.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/nats-io/nats-server/v2
Go
< 2.12.8
2.12.8
github.com/nats-io/nats-server/v2
Go
≥ 2.14.0-RC.1
< 2.14.3
2.14.3

References

Frequently Asked Questions

What is CVE-2026-58254?
CVE-2026-58254 is a security vulnerability in Github.com/nats io/nats server/v2 involving nats-server Leaf node connections bypass Nats-Trace-Dest permission check under CWE-863: Incorrect Authorization.
Which Github.com/nats io/nats server/v2 versions are affected?
Affected versions include releases prior to 2.12.8, 2.14.3 across affected packages: github.com/nats-io/nats-server/v2.
What version fixes CVE-2026-58254?
Upgrading to 2.12.8, 2.14.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/nats-io/nats-server/v2 affected?
Yes, github.com/nats-io/nats-server/v2 is affected in releases prior to 2.12.8, 2.14.3. Upgrade your dependency to 2.12.8, 2.14.3 or later.
What is the CVSS score of CVE-2026-58254?
CVE-2026-58254 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2026-58254?
CVE-2026-58254 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Go dependencies for CVE-2026-58254?
Run the dependency tree command: 'inspect dependencies for github.com/nats-io/nats-server/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-p3j5-5hrq-p75h",
  "modified" : "2026-11-20T23:31:59Z",
  "published" : "2026-11-20T23:31:59Z",
  "aliases" : [ "CVE-2026-58254" ],
  "summary" : "nats-server Leaf node connections bypass Nats-Trace-Dest permission check",
  "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 leafnode connections between servers and message tracing through NATS headers.\n\n### Problem Description\n\nMessage trace destination checks were applied to ordinary client connections but not consistently to messages arriving through leafnode connections.\n\nA leafnode operator could cause trace events to be sent to subjects that would not otherwise be permitted and could use trace-only behavior to prevent normal delivery or storage of affected messages.\n\nTrace events can include routing, subscription, account, service import and JetStream metadata. The payload of the original application message is not chosen through the trace event itself.\n\n### Affected Versions\n\nVersions v2.14.2, v2.12.7 and below are vulnerable. The issue is fixed in v2.14.3 and v2.12.8.\n\n### Workarounds\n\nWhere possible, avoid granting publish paths from less-trusted leaf nodes into subjects for which trace-only behavior would affect delivery guarantees. No other known workarounds are available aside from upgrading to a fixed release.\n\n### References\n\n * GHSA advisory: <https://github.com/nats-io/nats-server/security/advisories/GHSA-p3j5-5hrq-p75h>\n * Credit: Koda Reef",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/nats-io/nats-server/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.12.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/nats-io/nats-server/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.14.0-RC.1"
      }, {
        "fixed" : "2.14.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/nats-server/security/advisories/GHSA-p3j5-5hrq-p75h"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-58254"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/nats-server/commit/cbe845932980b71563efac5cfa4cc751c88936cd"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nats-io/nats-server"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/nats-server/releases/tag/v2.12.8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/nats-server/releases/tag/v2.14.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-20T23:31:59Z",
    "nvd_published_at" : "2026-07-08T20:16:55Z"
  }
}