NATS credentials are exposed in monitoring port via command-line argv
nats-io nats-server
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/nats-io/nats-server/v2 Go |
|
|
| github.com/nats-io/nats-server Go |
| No fix yet |
nats-io nats-server
| Product | Affected | Fixed in |
|---|---|---|
| github.com/nats-io/nats-server/v2 Go |
|
|
| github.com/nats-io/nats-server Go |
| No fix yet |
NATS-Server is a High-Performance server for NATS.io, a cloud and edge native messaging system. Prior to versions 2.11.15 and 2.12.6, if a nats-server is run with static credentials for all clients provided via argv (the command-line), then those credentials are visible to any user who can see the monitoring port, if that too is enabled. The `/debug/vars` end-point contains an unredacted copy of argv. Versions 2.11.15 and 2.12.6 contain a fix. As a workaround, configure credentials inside a configuration file instead of via argv, and do not enable the monitoring port if using secrets in argv. Best practice remains to not expose the monitoring port to the Internet, or to untrusted network sources.
From the CVE record · GitHub_M
NATS-Server exposes an unredacted copy of its command-line arguments through the monitoring port’s `/debug/vars` endpoint. If static client credentials are supplied on the command line and the monitoring port is enabled, anyone who can access that port can see the credentials.
Operators using Go package github.com/nats-io/nats-server/v2 before 2.11.15 or from 2.12.0-RC.1 to before 2.12.6, or github.com/nats-io/nats-server at any version, should check their deployments.