Skip to content
Threat Feed
high advisory

NATS Server Credentials Exposure via Monitoring Port

NATS servers configured with command-line credentials expose them through the `/debug/vars` endpoint on the monitoring port, affecting versions prior to 2.11.15 and between 2.12.0-RC.1 and 2.12.6, potentially leading to unauthorized access.

NATS.io is a high-performance, open-source messaging system designed for cloud, on-premise, IoT, and edge computing environments. A vulnerability exists where credentials passed via command-line arguments (argv) to the nats-server are exposed through the server's monitoring port. Specifically, if a NATS server is launched with client authentication details specified directly in the command line, this information becomes visible via the /debug/vars endpoint. This affects NATS server versions prior to 2.11.15 and versions 2.12.0-RC.1 through 2.12.6. Attackers with access to the monitoring port can extract these credentials and potentially gain unauthorized access to the NATS messaging system. This exposure represents a significant security risk, especially in environments where the monitoring port is accessible from untrusted networks.

Attack Chain

  1. A NATS server is deployed with the --user and --pass parameters in the command line (argv) to configure client authentication.
  2. The monitoring port is enabled on the NATS server, typically on port 8222.
  3. An attacker gains access to the monitoring port, either through network access or by exploiting a separate vulnerability.
  4. The attacker sends an HTTP GET request to the /debug/vars endpoint on the monitoring port (e.g., http://nats-server:8222/debug/vars).
  5. The server responds with a JSON payload containing system information, including the command-line arguments used to launch the server.
  6. The attacker parses the JSON response and extracts the credentials specified in the --user and --pass parameters.
  7. The attacker uses the extracted credentials to authenticate with the NATS server as a legitimate client.
  8. The attacker gains unauthorized access to the NATS messaging system, enabling them to publish, subscribe, and manage messages within the system, potentially leading to data breaches or service disruption.

Impact

Successful exploitation allows unauthorized access to the NATS messaging system. The number of affected deployments is unknown, but any NATS server running a vulnerable version with command-line credentials and an exposed monitoring port is at risk. Compromised NATS deployments can lead to data breaches, service disruption, or the use of the messaging system for malicious purposes. Organizations in any sector utilizing NATS for inter-service communication or real-time data streaming are potentially affected.

Recommendation

  • Configure NATS server credentials within a dedicated configuration file instead of passing them via command-line arguments, as recommended in the advisory's "Workarounds" section.
  • Disable the monitoring port if command-line arguments are used for credential management, as mentioned in the advisory's "Workarounds" section.
  • Implement network access controls to restrict access to the monitoring port from untrusted networks, as stated in the advisory's "Workarounds" section.
  • Upgrade to NATS server version 2.11.15 or 2.12.6 or later to patch CVE-2026-33247 as described in the advisory.

Detection coverage 3

Detect Access to NATS Monitoring Endpoint

medium

Detects access to the /debug/vars endpoint on the NATS monitoring port, which could indicate credential exposure.

sigma tactics: credential_access sources: webserver, linux

Detect NATS Server Process with User/Pass in Command Line

high

Detects NATS server processes running with --user and --pass command-line arguments, indicating potential credential exposure.

sigma tactics: credential_access sources: process_creation, linux

Detect NATS Server Monitoring Port Enabled

medium

Detects NATS server process with monitoring port enabled on port 8222

sigma tactics: discovery techniques: T1082 sources: process_creation, linux

Detection queries are available on the platform. Get full rules →