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

Medium CVSS 6.5

OSV id
GHSA-p3j5-5hrq-p75h
Also known as
BIT-nats-2026-58254, CVE-2026-58254
Published
Last modified

Affected packages

PackageAffected versionsFixed in
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

How to fix it

github.com/nats-io/nats-server/v2 (Go)

Upgrade github.com/nats-io/nats-server/v2 to 2.12.8 or later.

go get github.com/nats-io/nats-server/v2@v2.12.8
go mod tidy
  • Indirect Go modules are upgraded the same way (`go get module@version`).
  • Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.

github.com/nats-io/nats-server/v2 (Go)

Upgrade github.com/nats-io/nats-server/v2 to 2.14.3 or later.

go get github.com/nats-io/nats-server/v2@v2.14.3
go mod tidy
  • Indirect Go modules are upgraded the same way (`go get module@version`).
  • Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.

Not sure whether your project uses an affected version? Check your lockfile below for free.

Details

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

References

Am I affected?

Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.

or paste its content

Needed when you paste. package.json and pyproject.toml only have version ranges: use the lockfile next to them.

Only package names and versions are checked; the file itself is not kept. We use your email to send this report and nothing else unless you tick the box above. Privacy policy.

About this data

Source: GitHub Advisory Database via OSV.dev (CC-BY 4.0). Severity comes from the advisory's own rating when it has one, else from its CVSS score.