Skip to content

Sensitive data exposure in NATS

High severity GitHub Reviewed Published Oct 8, 2020 to the GitHub Advisory Database • Updated Sep 11, 2023

Package

npm nats (npm)

Affected versions

>= 2.0.0-201, <= 2.0.0-206

Patched versions

2.0.0-209
npm nats.ws (npm)
>= 1.0.0-85, <= 1.0.0-110
1.0.0-111

Description

Preview versions of two NPM packages and one Deno package from the NATS project contain an information disclosure flaw, leaking options to the NATS server; for one package, this includes TLS private credentials.

The _connection_ configuration options in these JavaScript-based implementations were fully serialized and sent to the server in the client's CONNECT message, immediately after TLS establishment.

The nats.js client supports Mutual TLS and the credentials for the TLS client key are included in the connection configuration options; disclosure of the client's TLS private key to the server has been observed.

Most authentication mechanisms are handled after connection, instead of as part of connection, so other authentication mechanisms are unaffected. For clarity: NATS account NKey authentication is NOT affected.

Neither the nats.ws nor the nats.deno clients support Mutual TLS: the affected versions listed below are those where the logic flaw is present. We are including the nats.ws and nats.deno versions out of an abundance of caution, as library maintainers, but rate as minimal the likelihood of applications leaking sensitive data.

Security impact:

  • NPM package nats.js:
  • mainline is unaffected
  • beta branch is vulnerable from 2.0.0-201, fixed in 2.0.0-209

Logic flaw:

  • NPM package nats.ws:
  • status: preview
  • flawed from 1.0.0-85, fixed in 1.0.0-111
  • status: preview
  • flawed in all git tags prior to fix
  • fixed with git tag v1.0.0-9

Impact:

For deployments using TLS client certificates (for mutual TLS), private key material for TLS is leaked from the client application to the server. If the server is untrusted (run by a third party), or if the client application also disables TLS verification (and so the true identity of the server is unverifiable) then authentication credentials are leaked.

References

Reviewed Oct 8, 2020
Published to the GitHub Advisory Database Oct 8, 2020
Last updated Sep 11, 2023

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

EPSS score

0.156%
(53rd percentile)

Weaknesses

CVE ID

CVE-2020-26149

GHSA ID

GHSA-82rf-q3pr-4f6p

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.