Skip to content

Incorrect handling of credential expiry by /nats-io/nats-server

Critical severity GitHub Reviewed Published Mar 24, 2021 in nats-io/jwt • Updated May 20, 2024

Package

gomod github.com/nats-io/jwt (Go)

Affected versions

< 1.1.0

Patched versions

1.1.0
gomod github.com/nats-io/nats-server/v2 (Go)
< 2.1.9
2.1.9

Description

Problem Description

NATS nats-server through 2020-10-07 has Incorrect Access Control because of how expired credentials are handled.

The NATS accounts system has expiration timestamps on credentials; the https://github.com/nats-io/jwt library had an API which encouraged misuse and an IsRevoked() method which misused its own API.

A new IsClaimRevoked() method has correct handling and the nats-server has been updated to use this. The old IsRevoked() method now always returns true and other client code will have to be updated to avoid calling it.

The CVE identifier should cover any application using the old JWT API, where the nats-server is one of those applications.

Affected versions

JWT library

  • all versions prior to 1.1.0
  • fixed after nats-io/jwt PR 103 landed (2020-10-06)

NATS Server

  • Version 2 prior to 2.1.9
    • 2.0.0 through and including 2.1.8 are vulnerable.
  • fixed with nats-io/nats-server PRs 1632, 1635, 1645

Impact

Time-based credential expiry did not work.

Workaround

Have credentials which only expire after fixes can be deployed.

Solution

Upgrade the JWT dependency in any application using it.

Upgrade the NATS server if using NATS Accounts.

References

Published by the National Vulnerability Database Nov 6, 2020
@philpennock philpennock published to nats-io/jwt Mar 24, 2021
Reviewed May 21, 2021
Published to the GitHub Advisory Database Feb 11, 2022
Last updated May 20, 2024

Severity

Critical

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
High
Availability
High

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:H/A:H

EPSS score

0.167%
(54th percentile)

Weaknesses

CVE ID

CVE-2020-26892

GHSA ID

GHSA-4w5x-x539-ppf5

Source code

No known source code
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.