Crítica

Client TLS credentials sent raw to server in npm package nats

  • Publicada: 06.04.2021
  • Actualizado: 11.10.2026 10:22

Nats is a Node.js client for the NATS messaging system.

Problem 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.

Affected versions

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
  • Deno repository https://github.com/nats-io/nats.deno

    • 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.

Workaround

None

Solution

Upgrade your package dependencies to fixed versions, and then reissue any TLS client credentials (with new keys, not just new certificates) and revoke the old ones.

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Paquete de npm nats >= 2.0.0-201, < 2.0.0-209 2.0.0-209

Referencias

Puntuación CVSS -
Debilidad (CWE)
CWE-522
Plataforma
npm
Paquete
nats
Publicada
06.04.2021
Actualizado
11.10.2026 10:22

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-prmc-5v5w-c465 - CC BY 4.0

Historial de vulnerabilidades: nats

Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Entradas en total
2
Primera → última
10.2020 04.2021
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Crítica 1
  • Alta 1

Divulgaciones por año

  1. 2020: 1
  2. 2021: 1
  3. 2022: 0
  4. 2023: 0
  5. 2024: 0
  6. 2025: 0
  7. 2026: 0
  1. Client TLS credentials sent raw to server in npm package nats esta entrada
    Crítica ghsa-prmc-5v5w-c465 >= 2.0.0-201, < 2.0.0-209 2.0.0-209
  2. Alta · 7.5 CVE-2020-26149 >= 2.0.0-201, < 2.0.0-209 2.0.0-209

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.