CVE-2026-58254: CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections
CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections Vulnerability ID: CVE-2026-58254 CVSS Score: 6.5 Published: 2026-11-20 NATS Server prior to versions 2.12.8 and 2.14.3 co
CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections
Vulnerability ID: CVE-2026-58254
CVSS Score: 6.5
Published: 2026-11-20
NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.
TL;DR
An incomplete fix for CVE-2026-33249 in NATS Server leaves leaf node connections exempt from Nats-Trace-Dest publish permission checks. Operators of connected leaf nodes can route internal trace audit payloads to arbitrary unauthorized subjects and disrupt message storage or forwarding via Nats-Trace-Only framing. Upgrading to NATS Server 2.12.8 or 2.14.3 resolves the flaw.
β οΈ Exploit Status: POC
Technical Details
- CVE ID: CVE-2026-58254 (GHSA-p3j5-5hrq-p75h)
- Weakness Class: CWE-863: Incorrect Authorization
- CVSS v3.1 / v4.0: 6.5 Medium (v3.1) / 5.3 Medium (v4.0)
- Attack Vector: Network (Leaf Node Protocol Port 7422)
- Affected Function: allowedToPublishOnMsgTraceDest (server/msgtrace.go)
- EPSS Score: 0.31% (24.25th Percentile)
- Exploit Status: Public Proof-of-Concept (PoC) Available
- CISA KEV Status: Not Listed
Affected Systems
- NATS Server (nats-io/nats-server)
- Bitnami NATS Server distributions (BIT-nats-2026-58254)
-
nats-server: <= 2.12.7 (Fixed in:
2.12.8) -
nats-server: >= 2.14.0-RC.1, <= 2.14.2 (Fixed in:
2.14.3)
Code Analysis
Commit: cbe8459
Enforce leaf node publish permissions (leafReceiveAllowed and leafSendAllowed) on Nats-Trace-Dest subjects when c.kind == LEAF.
File: server/msgtrace.go
@@ -529,7 +529,13 @@ func (c *client) allowedToPublishOnMsgTraceDest(s *Server, acc *Account, dest st
}
allowed := true
c.mu.Lock()
- if c.perms != nil && (c.perms.pub.allow != nil || c.perms.pub.deny != nil) && !c.pubAllowedFullCheck(dest, false, true) {
+ if c.kind == LEAF {
+ if c.isSpokeLeafNode() {
+ allowed = c.leafReceiveAllowed(td)
+ } else {
+ allowed = c.leafSendAllowed(td)
+ }
+ } else if c.perms != nil && (c.perms.pub.allow != nil || c.perms.pub.deny != nil) && !c.pubAllowedFullCheck(dest, false, true) {
allowed = false
}
c.mu.Unlock()
Exploit Details
- GitHub: Public research repository containing a standalone Python exploit harness and CLI verification tool for CVE-2026-58254.
Mitigation Strategies
- Upgrade NATS Server to patched releases v2.12.8 or v2.14.3 to enforce directional leaf node permission checks on Nats-Trace-Dest headers.
- Restrict network access to the NATS leaf node listener port (default TCP 7422) using firewall rules or mutual TLS (mTLS) so only trusted spoke servers can connect.
- Apply strict publish permission boundaries on leaf node user accounts, removing publish permissions completely for leaf nodes that only require subscription access.
- Monitor NATS Server logs for Publish Violation entries and unexpected message deliveries on restricted internal subjects.
Remediation Steps:
- Identify all NATS Server hub and spoke instances running versions <= 2.12.7 or 2.14.0-RC.1 through 2.14.2.
- Download and deploy NATS Server v2.12.8 (for 2.12.x deployments) or v2.14.3 (for 2.14.x deployments) from the official nats-io/nats-server release repository.
- Perform a rolling restart of the NATS cluster nodes to load the patched binary.
- Verify the active server version by querying the server INFO banner or monitoring endpoint (/varz) and confirming that unauthorized Nats-Trace-Dest probes trigger a Publish Violation log entry.
References
- CVE-2026-58254 Official Record (CVE.org)
- NVD Vulnerability Detail: CVE-2026-58254
- GitHub Security Advisory GHSA-p3j5-5hrq-p75h
- NATS Server Patch Commit cbe845932980b71563efac5cfa4cc751c88936cd
- NATS Server Release v2.12.8
- NATS Server Release v2.14.3
- Proof-of-Concept Research Repository (googlesky/CVE-2026-58254)
- Shodan CVE Intelligence: CVE-2026-58254
Read the full report for CVE-2026-58254 on our website for more details including interactive diagrams and full exploit analysis.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.