# CVE-2026-58254: nats-server Leaf node connections bypass Nats-Trace-Dest permission check

- **Severity:** MEDIUM 5.3
- **CVSS:** 5.3 (v4.0, GitHub) `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`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Attack requirements: None; Privileges required: Low; User interaction: None; Confidentiality impact: Low; Integrity impact: Low; Availability impact: Low; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, login needed
- **EPSS:** 0.31% (percentile 16, 2026-11-28)
- **CWE:** CWE-863
- **Aliases:** BIT-nats-2026-58254, GHSA-p3j5-5hrq-p75h, GO-2026-7025
- **Published:** 2026-11-20T23:31:59.000Z
- **Modified:** 2026-11-23T20:41:23.849Z

## Who should check

- Projects that depend on Go package github.com/nats-io/nats-server/v2 (\< 2.12.8)

## Description

\#\#\# 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

## Affected and fixed versions

- Go `github.com/nats-io/nats-server/v2`: affected \< 2.12.8; fixed 2.12.8, 2.14.3 (ghsa)

## Technologies

Go modules

## Mitigation

- Upgrade github.com/nats-io/nats-server/v2 to one of 2.12.8, 2.14.3 (or later in the same release line).

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-58254. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-58254.md
Affected: github.com/nats-io/nats-server/v2 < 2.12.8
Fixed in: 2.12.8, 2.14.3

Steps:
1. Search this machine and project for github.com/nats-io/nats-server/v2 (Go): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-58254 being exploited?

There is no confirmed exploitation: CVE-2026-58254 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.31% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2026-58254?

Medium: CVSS 5.3 (v4.0, scored by GitHub). Remote, login needed.

### Which versions are affected by CVE-2026-58254?

github.com/nats-io/nats-server/v2 \< 2.12.8.

### Is there a fix for CVE-2026-58254?

Yes. Fixed in 2.12.8, 2.14.3. Upgrade github.com/nats-io/nats-server/v2 to one of 2.12.8, 2.14.3 (or later in the same release line).

### How do I check if I'm affected by CVE-2026-58254?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/nats-io/nats-server/security/advisories/GHSA-p3j5-5hrq-p75h>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2026-58254>
- patch: <https://github.com/nats-io/nats-server/commit/cbe845932980b71563efac5cfa4cc751c88936cd>
- other: <https://github.com/nats-io/nats-server/releases/tag/v2.12.8>
- other: <https://github.com/nats-io/nats-server/releases/tag/v2.14.3>
- other: <https://github.com/advisories/GHSA-p3j5-5hrq-p75h>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- GitHub Advisory Database: CC-BY 4.0 <https://github.com/advisories/GHSA-p3j5-5hrq-p75h> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GO-2026-7025> (license: <https://creativecommons.org/licenses/by/4.0/>)
- FIRST EPSS: EPSS scores by FIRST <https://www.first.org/epss/>

HTML: <https://flawdb.com/CVE-2026-58254> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-58254>
