CVE-2026-29785 Overview
CVE-2026-29785 is a Denial of Service vulnerability affecting NATS-Server, a high-performance server for NATS.io, a cloud and edge native messaging system. When the leafnode configuration is enabled (not default), any unauthenticated user who can connect to the server can trigger a panic and crash the nats-server. This vulnerability occurs pre-authentication and requires that compression be enabled, which is the default setting when leafnodes are used.
Critical Impact
Unauthenticated remote attackers can crash NATS-Server instances with leafnode configurations enabled, causing complete service disruption to messaging infrastructure.
Affected Products
- NATS-Server versions prior to 2.11.14
- NATS-Server versions prior to 2.12.5
- Any NATS-Server deployment with leafnode configuration enabled and compression active (default)
Discovery Timeline
- 2026-03-25 - CVE-2026-29785 published to NVD
- 2026-03-26 - Last updated in NVD database
Technical Details for CVE-2026-29785
Vulnerability Analysis
This vulnerability is classified under CWE-476 (NULL Pointer Dereference), indicating that the server fails to properly handle certain conditions during leafnode connection processing. The flaw exists in the compression handling code path for leafnode connections.
When a leafnode connection is established, the server processes incoming data with compression enabled by default. An attacker can craft specific input that causes the server to dereference a null pointer, triggering a panic condition. Since this occurs in the pre-authentication phase of connection handling, no valid credentials are required to exploit this vulnerability.
The attack surface is exposed on the network, requires low complexity to exploit, and needs no user interaction or special privileges. The impact is limited to availability—there is no confidentiality or integrity breach—but a successful attack results in complete denial of service for the messaging infrastructure.
Root Cause
The root cause is a NULL Pointer Dereference (CWE-476) in the leafnode compression handling code. During the initial connection handshake, the server fails to validate certain pointers before dereferencing them, allowing an attacker to trigger a panic condition. The compression subsystem expects certain data structures to be properly initialized, but malformed input can bypass these assumptions.
Attack Vector
The attack is network-based and can be executed by any attacker who can establish a TCP connection to the leafnode port. The exploitation flow involves:
- Attacker identifies a NATS-Server instance with leafnode configuration enabled
- Attacker connects to the leafnode port (compression is enabled by default)
- Attacker sends specially crafted data during the pre-authentication phase
- Server attempts to process the data through the compression handler
- NULL pointer dereference occurs, causing a panic
- Server crashes, denying service to all connected clients
The vulnerability is particularly concerning because it requires no authentication, meaning any network-accessible leafnode port is vulnerable to exploitation.
Detection Methods for CVE-2026-29785
Indicators of Compromise
- Unexpected NATS-Server crashes with panic messages in logs related to leafnode or compression handling
- Repeated connection attempts to leafnode ports from suspicious IP addresses followed by immediate server restarts
- Log entries showing pre-authentication connection failures on leafnode ports
- Unusual network traffic patterns targeting the leafnode listener port
Detection Strategies
- Monitor NATS-Server process stability and alert on unexpected restarts or crashes
- Implement network intrusion detection rules for anomalous leafnode connection patterns
- Review server logs for panic stack traces mentioning compression or leafnode code paths
- Deploy application-level monitoring to track leafnode connection success/failure ratios
Monitoring Recommendations
- Enable verbose logging for leafnode connections to capture detailed connection metadata
- Set up automated alerts for NATS-Server process terminations
- Monitor network flows to leafnode ports for connections that terminate abnormally before authentication
- Implement health checks that can rapidly detect and alert on server unavailability
How to Mitigate CVE-2026-29785
Immediate Actions Required
- Upgrade NATS-Server to version 2.11.14 or 2.12.5 (or later) immediately
- If immediate patching is not possible, disable compression on the leafnode port as a workaround
- Review firewall rules to restrict leafnode port access to trusted networks only
- Monitor for any signs of exploitation attempts in server logs
Patch Information
Fixed versions are available:
- Version 2.11.14 for the 2.11.x branch
- Version 2.12.5 for the 2.12.x branch
The fix is implemented in commit a1488de6f2ba6e666aef0f9cce0016f7f167d6a8. For detailed patch information, refer to the GitHub Security Advisory GHSA-52jh-2xxh-pwh6 and the NATS Security Advisory.
Workarounds
- Disable compression on the leafnode port by modifying the server configuration
- Restrict network access to leafnode ports using firewall rules to allow only trusted cluster members
- Consider placing leafnode ports behind a VPN or private network segment if public exposure is not required
# Configuration example - Disable leafnode compression as a workaround
# In your nats-server configuration file (nats-server.conf):
leafnodes {
port: 7422
compression: "off"
}
# Then restart the NATS-Server:
# systemctl restart nats-server
# or
# nats-server -c /path/to/nats-server.conf
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


