# CVE-2026-29785: nats-io nats-server NULL pointer dereference in leafnode protocol

Source: https://junglewise.ai/threats/cve-2026-29785-nats-io-nats-server-null-pointer-dereference-in-leafnode-protocol  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-03-25. Updated: 2026-06-30  
License: CC BY 4.0 with a link back

CVE-2026-29785 · Severity: high · CVSS 7.5 · Published 2026-03-25

NATS-Server, a high-performance messaging system used for cloud and edge computing, is vulnerable to a denial-of-service attack. If the 'leafnode' feature is enabled, an unauthenticated remote attacker can crash the server by sending specific commands before the connection is fully established. This results in a complete service outage, potentially disrupting data communication between distributed systems or IoT devices.

Technologies: [github.com/nats-io/nats-server (Go)](https://junglewise.ai/threats/technologies/github-com-nats-io-nats-server), [github.com/nats-io/nats-server/v2 (Go)](https://junglewise.ai/threats/technologies/github-com-nats-io-nats-server-v2), [Red Hat Multicluster Global Hub](https://junglewise.ai/threats/technologies/multicluster-global-hub). Vendors: [Go](https://junglewise.ai/threats/vendors/go), [Red Hat](https://junglewise.ai/threats/vendors/red-hat).

## Quick answers

**Is CVE-2026-29785 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-29785 being exploited in the wild.

**How severe is CVE-2026-29785?** High severity, with a CVSS score of 7.5, published 25 March 2026.

**Which products and versions are affected?** github.com/nats-io/nats-server (Go) SEMVER:introduced=0; github.com/nats-io/nats-server/v2 (Go) SEMVER:introduced=0,fixed=2.11.14, SEMVER:introduced=0,fixed=2.11.14,introduced=2.12.0-RC.1,fixed=2.12.5; Red Hat Multicluster Global Hub 1.4.5, 1.5.4, 1.6.2.

**Is there a fix for CVE-2026-29785?** Yes. github.com/nats-io/nats-server/v2 (Go): upgrade to 2.11.14, 2.12.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-29785 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-29785?** Check whether you run github.com/nats-io/nats-server (Go), github.com/nats-io/nats-server/v2 (Go) or Red Hat Multicluster Global Hub at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- github.com/nats-io/nats-server/v2 (Go): upgrade to 2.11.14, 2.12.5 or later

  ```sh
  go get github.com/nats-io/nats-server/v2@v2.12.5
  ```


## Technical details

A NULL pointer dereference (CWE-476) exists in NATS-Server's leafnode protocol handling. When compression is enabled on a leafnode port (typically 7422), the server may process 'LS+' (Leafnode Subscribe) commands before the 'CONNECT' command has been fully processed, leading to a nil pointer access for the client account object. This vulnerability is reachable over the network without authentication. The issue is fixed in versions 2.11.14 and 2.12.5. A known workaround is to disable compression within the leafnodes configuration block.

## Affected products

- nats-io nats-server < 2.11.14, >= 2.12.0-RC.1 < 2.12.5
- Red Hat Multicluster Global Hub 1.4.5, 1.5.4, 1.6.2

## Identifiers

- CVE-2026-29785
- GHSA-52jh-2xxh-pwh6
- GO-2026-4829

## Timeline

- 2026-03-02: other: Fix authored by maintainers
- 2026-03-09: advisory: Internal advisory date
- 2026-03-25: disclosed: Public disclosure of CVE-2026-29785
- 2026-03-25: patched: Fixed versions released

## References

- [https://advisories.nats.io/CVE/secnote-2026-04.txt](https://advisories.nats.io/CVE/secnote-2026-04.txt)
- [https://github.com/nats-io/nats-server/commit/a1488de6f2ba6e666aef0f9cce0016f7f167d6a8](https://github.com/nats-io/nats-server/commit/a1488de6f2ba6e666aef0f9cce0016f7f167d6a8)
- [https://github.com/nats-io/nats-server/security/advisories/GHSA-52jh-2xxh-pwh6](https://github.com/nats-io/nats-server/security/advisories/GHSA-52jh-2xxh-pwh6)
- [https://access.redhat.com/errata/RHSA-2026:21769](https://access.redhat.com/errata/RHSA-2026:21769)
- [https://access.redhat.com/errata/RHSA-2026:22347](https://access.redhat.com/errata/RHSA-2026:22347)
- [https://access.redhat.com/errata/RHSA-2026:23345](https://access.redhat.com/errata/RHSA-2026:23345)
- [https://access.redhat.com/security/cve/CVE-2026-29785](https://access.redhat.com/security/cve/CVE-2026-29785)

## Related threats

- [Red Hat Multicluster Global Hub privilege escalation during ManagedClusterMigration](https://junglewise.ai/threats/cve-2026-71577-red-hat-multicluster-global-hub-privilege-escalation-during)
- [Red Hat Multicluster Global Hub authentication bypass in Kafka CloudEvents](https://junglewise.ai/threats/cve-2026-71576-red-hat-multicluster-global-hub-authentication-bypass-in-kafka)
- [Apache Thrift improper certificate validation in TSSLTransportFactory](https://junglewise.ai/threats/cve-2026-43869-apache-thrift-improper-certificate-validation-in)
- [Apache Thrift out-of-bounds read in C++ JSON implementation](https://junglewise.ai/threats/cve-2026-41607-apache-thrift-out-of-bounds-read-in-c-json-implementation)
- [Apache Thrift uncontrolled recursion in c_glib dispatch](https://junglewise.ai/threats/cve-2026-41606-apache-thrift-uncontrolled-recursion-in-c-glib-dispatch)
