CVE-2020-26892: Github.com/nats io/jwt Incorrect Handling Of Credential Expiry Vulnerability

CRITICAL
Advisory Identifier: GHSA-4w5x-x539-ppf5
CVSS 9.8
CWE-798
Published
Advisory Summary

CVE-2020-26892 is a CRITICAL (CVSS 9.8) incorrect handling of credential expiry vulnerability (CWE-798: Use of Hard-coded Credentials) affecting Github.com/nats io/jwt libraries in the Go ecosystem. The issue involves incorrect handling of credential expiry by /nats-io/nats-server. Remediation is available by upgrading affected packages to version 1.1.0.

CVE-2020-26892 at a Glance

CVE Identifier CVE-2020-26892
GHSA Identifier GHSA-4w5x-x539-ppf5
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-798: Use of Hard-coded Credentials
Affected Product Github.com/nats io/jwt
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.8

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2020-26892

To remediate this vulnerability, upgrade all affected Github.com/nats io/jwt dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/nats-io/jwt fixed: 1.1.0
Upgrade github.com/nats-io/jwt to 1.1.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/nats-io/jwt

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-26892, inspect your project dependencies for Github.com/nats io/jwt:

inspect dependencies for github.com/nats-io/jwt

Analyze the terminal output to locate any version of Github.com/nats io/jwt in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-798: Use of Hard-coded Credentials, where the product contains hard-coded credentials, such as a password or cryptographic key. In Github.com/nats io/jwt, 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

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

CVE-2020-26892 Affected Github.com/nats io/jwt Versions

1 component(s)
Fixed Versions:
1.1.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/nats-io/jwt
Go
< 1.1.0
1.1.0

References

Frequently Asked Questions

What is CVE-2020-26892?
CVE-2020-26892 is a security vulnerability in Github.com/nats io/jwt involving Incorrect handling of credential expiry by /nats-io/nats-server under CWE-798: Use of Hard-coded Credentials.
Which Github.com/nats io/jwt versions are affected?
Affected versions include releases prior to 1.1.0 across affected packages: github.com/nats-io/jwt.
What version fixes CVE-2020-26892?
Upgrading to 1.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/nats-io/jwt affected?
Yes, github.com/nats-io/jwt is affected in releases prior to 1.1.0. Upgrade your dependency to 1.1.0 or later.
What is the CVSS score of CVE-2020-26892?
CVE-2020-26892 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2020-26892?
CVE-2020-26892 is classified under CWE-798: Use of Hard-coded Credentials (The product contains hard-coded credentials, such as a password or cryptographic key.).
How can I check Go dependencies for CVE-2020-26892?
Run the dependency tree command: 'inspect dependencies for github.com/nats-io/jwt'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4w5x-x539-ppf5",
  "modified" : "2025-10-03T19:21:38Z",
  "published" : "2022-02-11T23:42:20Z",
  "aliases" : [ "CVE-2020-26892" ],
  "summary" : "Incorrect handling of credential expiry by /nats-io/nats-server",
  "details" : "## Problem Description\n\nNATS nats-server through 2020-10-07 has Incorrect Access Control because of how expired credentials are handled.\n\nThe 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.\n\nA 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.\n\nThe CVE identifier should cover any application using the old JWT API, where the nats-server is one of those applications.\n\n\n## Affected versions\n\n#### JWT library\n\n * all versions prior to 1.1.0\n * fixed after nats-io/jwt PR 103 landed (2020-10-06)\n\n#### NATS Server\n\n * Version 2 prior to 2.1.9\n   + 2.0.0 through and including 2.1.8 are vulnerable.\n * fixed with nats-io/nats-server PRs 1632, 1635, 1645\n\n\n## Impact\n\nTime-based credential expiry did not work.\n\n\n## Workaround\n\nHave credentials which only expire after fixes can be deployed.\n\n\n## Solution\n\nUpgrade the JWT dependency in any application using it.\n\nUpgrade the NATS server if using NATS Accounts.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/nats-io/jwt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/jwt/security/advisories/GHSA-4w5x-x539-ppf5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-26892"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/jwt/commit/e11ce317263cef69619fc1ca743b195d02aa1d8a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/nats-server/commit/1e08b67f08e18cd844dce833a265aaa72500a12f"
  }, {
    "type" : "WEB",
    "url" : "https://advisories.nats.io/CVE/CVE-2020-26892.txt"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nats-io/jwt"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/nats-server/commits/master"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VT67XCLIIBYRT762SVFBYFFTQFVSM3SI"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-0380"
  }, {
    "type" : "WEB",
    "url" : "https://www.openwall.com/lists/oss-security/2020/11/02/2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-798" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-21T21:18:09Z",
    "nvd_published_at" : "2020-11-06T08:15:00Z"
  }
}