NATS server TLS missing ciphersuite settings when CLI flags used
Description
(This advisory is canonically <https://advisories.nats.io/CVE/CVE-2021-32026.txt>)
Problem
Description
The NATS server by default uses a restricted set of modern ciphersuites for TLS. This selection can be overridden through configuration. The defaults include just RSA and ECDSA with either AES/GCM with a SHA2 digest or ChaCha20/Poly1305.
The configuration system allows for extensive use of CLI options to override configuration settings. When using these to set a key/cert for TLS, the restricted ciphersuite settings were lost, enabling all ciphersuites supported by Go by default.
None of these additional ciphersuites are broken, so the NATS maintainers have fixed this in public git and the next release is not being hurried, nor is this security advisory embargoed.
Affected versions
NATS Server: * All versions prior to 2.2.3 * fixed with nats-io/nats-server commit ffccc2e1bd (2021-04-29)
Impact
If a server administrator chooses to start the nats-server with TLS configuration parameters provided on the command-line, then clients can negotiate TLS ciphersuites which were not expected.
Workaround
Use a configuration file to set the TLS parameters instead of command-line options.
Solution
Upgrade the NATS server.
Credits
This issue was identified and reported by SimCorp.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
NATS server prior to 2.2.3 loses restricted TLS ciphersuite defaults when TLS parameters are set via CLI options, allowing negotiation of all Go-supported ciphersuites.
Vulnerability
Overview
CVE-2021-32026 is a low-severity vulnerability in the NATS server (nats-server) that affects the TLS ciphersuite configuration. The NATS server by default uses a restricted set of modern TLS ciphersuites, limited to RSA and ECDSA with AES/GCM and a SHA2 digest or ChaCha20/Poly1305 [2]. However, when an administrator provides TLS key and certificate parameters via command-line interface (CLI) options, the restricted ciphersuite settings are inadvertently lost, causing the server to enable all ciphersuites supported by the Go standard library by default [1][2].
Exploitation
The attack vector requires the server administrator to have started the nats-server with TLS configuration parameters supplied on the command line rather than through a configuration file [2]. No authentication or network position beyond the ability to initiate a TLS handshake is needed. A client connecting to such a server can then negotiate any TLS ciphersuite supported by Go, including older or weaker ciphersuites that were not part of the intended restricted set [1][2].
Impact
While none of the additional ciphersuites are known to be broken as of the advisory publication, the change weakens the server's security posture by expanding the set of ciphersuites available for TLS negotiation [2]. This could potentially allow an attacker to leverage a weaker ciphersuite if a future vulnerability is discovered in those algorithms. The impact is considered low because the default restricted set remains in effect when TLS is configured via configuration files.
Mitigation
The NATS maintainers addressed this issue in commit ffccc2e1bd (2021-04-29) and released the fix in nats-server version 2.2.3 [2]. Users should upgrade to 2.2.3 or later. For those unable to upgrade immediately, the workaround is to always use a configuration file to set TLS parameters instead of CLI options [1][2]. The advisory was not embargoed and the fix was made publicly available in the development repository prior to the release [2].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/nats-io/nats-server/v2Go | < 2.2.3 | 2.2.3 |
Affected products
6- Range: < 2.2.3
- osv-coords5 versionspkg:apk/chainguard/nats-serverpkg:apk/chainguard/nats-server-compatpkg:apk/wolfi/nats-serverpkg:apk/wolfi/nats-server-compatpkg:golang/github.com/nats-io/nats-server/v2
< 0+ 4 more
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 0
- (no CPE)range: < 2.2.3
Patches
1ffccc2e1bd7a[FIXED] TLS: default ciphers not set when tls enabled from command line
2 files changed · +5 −0
server/opts.go+1 −0 modified@@ -4342,6 +4342,7 @@ func overrideTLS(opts *Options) error { tc.KeyFile = opts.TLSKey tc.CaFile = opts.TLSCaCert tc.Verify = opts.TLSVerify + tc.Ciphers = defaultCipherSuites() var err error opts.TLSConfig, err = GenTLSConfig(&tc)
server/opts_test.go+4 −0 modified@@ -1522,6 +1522,10 @@ func TestConfigureOptions(t *testing.T) { if opts.TLSConfig == nil || !opts.TLS { t.Fatal("Expected TLSConfig to be set") } + // Check that we use default TLS ciphers + if !reflect.DeepEqual(opts.TLSConfig.CipherSuites, defaultCipherSuites()) { + t.Fatalf("Default ciphers not set, expected %v, got %v", defaultCipherSuites(), opts.TLSConfig.CipherSuites) + } } func TestClusterPermissionsConfig(t *testing.T) {
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5News mentions
0No linked articles in our index yet.