Vulnerabilities in pkg:npm/nats
PACKAGECVE-2020-26149 is a HIGH (CVSS 7.5) sensitive data exposure vulnerability (CWE-522: Insufficiently Protected Credentials) affecting Nats libraries in the npm ecosystem. The issue involves sensitive data exposure in nats. Remediation is available by upgrading affected packages to version 2.0.0-209, 1.0.0-111.
pkg:npm/nats
Vulnerability advisories affecting package pkg:npm/nats. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-82rf-q3pr-4f6p | CVE-2020-26149 | HIGH | Sensitive data exposure in NATS |
| GHSA-prmc-5v5w-c465 | - | CRITICAL | Client TLS credentials sent raw to server in npm package nats |
CVE-2020-26149 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2020-26149
To remediate this vulnerability, upgrade all affected Nats dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install nats@2.0.0-209
npm install nats.ws@1.0.0-111
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls nats
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-26149, inspect your project dependencies using npm:
npm ls nats
Analyze the terminal output to locate any version of Nats in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0-209), your application is affected.
Note: The npm ls nats command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-522: Insufficiently Protected Credentials, where the product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. In Nats, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-26149 Affected Nats Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
nats
|
npm |
≥ 2.0.0-201
< 2.0.0-209
|
2.0.0-209
|
|
nats.ws
|
npm |
≥ 1.0.0-85
< 1.0.0-111
|
1.0.0-111
|
References
Frequently Asked Questions
What is CVE-2020-26149?
Which Nats versions are affected?
What version fixes CVE-2020-26149?
Is nats affected?
Is nats.ws affected?
What is the CVSS score of CVE-2020-26149?
What CWE is associated with CVE-2020-26149?
How can I check npm dependencies for CVE-2020-26149?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-82rf-q3pr-4f6p",
"modified" : "2023-09-11T20:18:19Z",
"published" : "2020-10-08T22:11:32Z",
"aliases" : [ "CVE-2020-26149" ],
"summary" : "Sensitive data exposure in NATS",
"details" : "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.\n\nThe `_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.\n\nThe 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.\n\nMost 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.\n\nNeither 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.\n\n### Security impact:\n\n* NPM package nats.js:\n+ mainline is unaffected\n+ beta branch is vulnerable from 2.0.0-201, fixed in 2.0.0-209\n\n### Logic flaw:\n\n* NPM package nats.ws:\n+ status: preview\n+ flawed from 1.0.0-85, fixed in 1.0.0-111\n* Deno repository https://github.com/nats-io/nats.deno\n+ status: preview\n+ flawed in all git tags prior to fix\n+ fixed with git tag v1.0.0-9\n\n### Impact:\n\nFor 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "nats"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0-201"
}, {
"fixed" : "2.0.0-209"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.0.0-206"
}
}, {
"package" : {
"ecosystem" : "npm",
"name" : "nats.ws"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0-85"
}, {
"fixed" : "1.0.0-111"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.0.0-110"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-26149"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats.ws/commit/0a37ac2a411ff63f0707cda69a268c5fc4079eb7"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats.deno/compare/v1.0.0-8...v1.0.0-9"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nats-io/nats.ws"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2020/09/30/3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-522" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-10-08T22:11:09Z",
"nvd_published_at" : null
}
}