Information Disclosure in nats npm Package
Summary
GHSA-prmc-5v5w-c465: Client TLS credentials sent raw to server in npm package nats. Affects nats versions >= 2.0.0-201, < 2.0.0-209. Fixed in 2.0.0-209. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The nats package is a Node.js client for the NATS messaging system. It allows applications to connect to a NATS server and exchange messages. The package supports various authentication mechanisms, including Mutual TLS for secure communication. However, preview versions of the nats.js, nats.ws, and nats.deno packages contain an information disclosure flaw. This flaw leaks options to the NATS server, including TLS private credentials in the case of nats.js. The flaw occurs when the connection configuration options are serialized and sent to the server immediately after TLS establishment. This vulnerability affects specific versions of the nats.js, nats.ws, and nats.deno packages.
Vulnerability Detail
The vulnerability in the nats package allows for the disclosure of TLS client credentials, including the private key, to the server. This can lead to the leakage of sensitive information if the server is untrusted or if the client application disables TLS verification. The flaw occurs due to the serialization and transmission of the connection configuration options to the server. It is important to note that NATS account NKey authentication is not affected by this vulnerability. The affected versions of the nats package are listed below:
How To Fix
Minimum fixed version
2.0.0-209
This is the first release that contains the fix.
npm install nats@2.0.0-209
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. Upgrading to the fixed versions is the recommended solution.
Conclusion
In conclusion, the nats package is vulnerable to an information disclosure flaw that can lead to the leakage of TLS client credentials. It is crucial to upgrade to the fixed versions and reissue TLS client credentials to mitigate the risk of sensitive information disclosure. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for nats →
FAQ
The impact of this vulnerability is the potential leakage of TLS client credentials, including the private key, to the server. If the server is untrusted or if TLS verification is disabled, this can lead to the disclosure of sensitive information and authentication credentials.
The affected versions of the nats package are as follows:
- nats.js: beta branch versions 2.0.0-201 to 2.0.0-208
- nats.ws: preview versions 1.0.0-85 to 1.0.0-110
- nats.deno: all git tags prior to v1.0.0-9
No, NATS account NKey authentication is not affected by this vulnerability.
No, there are no known workarounds for this vulnerability. Upgrading to the fixed versions is the recommended solution.
To fix this vulnerability, you should upgrade your package dependencies to the fixed versions. Additionally, it is recommended to reissue any TLS client credentials with new keys and revoke the old ones.
References
Related vulnerabilities
Recent vulnerabilities recorded for nats.