CVE-2026-29785: NATS Server panic via malicious compression on leafnode port
Background
NATS.io is a high performance open source pub-sub distributed communication technology, built for the cloud, on-premise, IoT, and edge computing.
When configured to accept leafnode connections (for a hub/spoke topology of multiple nats-servers), then the default configuration allows for negotiating compression; a malicious remote NATS server can trigger a server panic via that compression.
Problem Description
If the nats-server has the "leafnode" configuration enabled (not default), then anyone who can connect can crash the nats-server by triggering a panic. This happens pre-authentication and requires that compression be enabled (which it is, by default, when leafnodes are used).
Context: a NATS server can form various clustering topologies, including local clusters, and superclusters of clusters, but leafnodes allow for separate administrative domains to link together with limited data communication; eg, a server in a moving vehicle might use a local leafnode for agents to connect to, and sync up to a central service as and when available. The leafnode configuration here is where the central server allows other NATS servers to connect into it, almost like regular NATS clients. Documentation examples typically use port 7422 for leafnode communications.
Affected Versions
Version 2, prior to v2.11.14 or v2.12.5
Workarounds
Disable compression on the leafnode port:
leafnodes { port: 7422 compression: off }
Other sources
NATS Server panic via malicious compression on leafnode port
— Microsoft
NATS-Server is a High-Performance server for NATS.io, a cloud and edge native messaging system. Prior to versions 2.11.14 and 2.12.5, if the nats-server has the "leafnode" configuration enabled (not default), then anyone who can connect can crash the nats-server by triggering a panic. This happens pre-authentication and requires that compression be enabled (which it is, by default, when leafnodes are used). Versions 2.11.14 and 2.12.5 contain a fix. As a workaround, disable compression on the leafnode port.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
go/github.com/nats-io/nats-server/v2to a version that resolves this vulnerability.Fixed in 2.12.5 - Upgrade
Upgrade
go/github.com/nats-io/nats-server/v2to a version that resolves this vulnerability.Fixed in 2.11.14 - Upgrade
Upgrade
NATS Serverto a version that resolves this vulnerability.Fixed in 2.11.14 - Upgrade
Upgrade
NATS Serverto a version that resolves this vulnerability.Fixed in 2.12.5 - Configuration
As a workaround, disable compression on the leafnode port (example config: `compression: off` and leafnode `port: 7422`).
NATS Server (leafnodes) compression = off
Event History
Frequently Asked Questions
What is the severity of CVE-2026-29785?
CVE-2026-29785 has been assessed with a severity that indicates a significant risk for users of affected NATS servers.
How do I fix CVE-2026-29785?
To fix CVE-2026-29785, upgrade to NATS Server version 2.12.5 or 2.11.14 as applicable.
What versions are affected by CVE-2026-29785?
CVE-2026-29785 affects NATS Server versions from 2.12.0-RC.1 up to 2.12.5 and all versions below 2.11.14.
What configurations are vulnerable in CVE-2026-29785?
CVE-2026-29785 vulnerabilities arise when NATS is configured to accept leafnode connections in a hub/spoke topology.
Is there a workaround for CVE-2026-29785 before upgrading?
There is no documented workaround for CVE-2026-29785, so upgrading to the latest version is recommended.