GHSA-9r5x-fjv3-q6h4: Duplicate Advisory Incorrect Access Control Vulnerability

HIGH
CVSS 7.5
CWE-284 CWE-863
Published
Advisory Summary

GHSA-9r5x-fjv3-q6h4 is a HIGH (CVSS 7.5) incorrect access control vulnerability (CWE-284: Improper Access Control) affecting Duplicate Advisory libraries in the Go ecosystem. The issue involves incorrect access control in github.com/nats-io/jwt and github.com/nats-io/nats-server/v2. Remediation is available by upgrading affected packages to version 2.0.1, 2.2.0, 1.2.3-0.20210314221642-a826c77dc9d2.

GHSA-9r5x-fjv3-q6h4 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-9r5x-fjv3-q6h4
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-284: Improper Access Control
Affected Product Duplicate Advisory
Package Ecosystem Go
Published Date
Last Updated

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

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 None (I:N)
Availability None (A:N)

How to Fix GHSA-9r5x-fjv3-q6h4

To remediate this vulnerability, upgrade all affected Duplicate Advisory 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/v2 fixed: 2.0.1
Upgrade github.com/nats-io/jwt/v2 to 2.0.1
github.com/nats-io/nats-server/v2 fixed: 2.2.0
Upgrade github.com/nats-io/nats-server/v2 to 2.2.0
github.com/nats-io/jwt fixed: 1.2.3-0.20210314221642-a826c77dc9d2
Upgrade github.com/nats-io/jwt to 1.2.3-0.20210314221642-a826c77dc9d2
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/v2

How to Check if You Are Affected

To determine whether your application is affected by GHSA-9r5x-fjv3-q6h4, inspect your project dependencies for Duplicate Advisory:

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

Analyze the terminal output to locate any version of Duplicate Advisory in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.1), 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Duplicate Advisory, 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

## Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-62mh-w5cv-p88c (for github.com/nats-io/jwt) and GHSA-j756-f273-xhp4 (for github.com/nats-io/nats-server). This link is maintained to preserve external references. ## Original Description NATS Server (github.com/nats-io/nats-server/v2/server) 2.x before 2.2.0 and JWT library (github.com/nats-io/jwt/v2) before 2.0.1 have Incorrect Access Control because Import Token bindings are mishandled.

GHSA-9r5x-fjv3-q6h4 Affected Duplicate Advisory Versions

3 component(s)
Fixed Versions:
2.0.12.2.01.2.3-0.20210314221642-a826c77dc9d2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/nats-io/jwt/v2
Go
< 2.0.1
2.0.1
github.com/nats-io/nats-server/v2
Go
< 2.2.0
2.2.0
github.com/nats-io/jwt
Go
< 1.2.3-0.20210314221642-a826c77dc9d2
1.2.3-0.20210314221642-a826c77dc9d2

References

Frequently Asked Questions

What is GHSA-9r5x-fjv3-q6h4?
GHSA-9r5x-fjv3-q6h4 is a security vulnerability in Duplicate Advisory involving Incorrect Access Control in github.com/nats-io/jwt and github.com/nats-io/nats-server/v2 under CWE-284: Improper Access Control.
Which Duplicate Advisory versions are affected?
Affected versions include releases prior to 2.0.1, 2.2.0, 1.2.3-0.20210314221642-a826c77dc9d2 across affected packages: github.com/nats-io/jwt/v2, github.com/nats-io/nats-server/v2, github.com/nats-io/jwt.
What version fixes GHSA-9r5x-fjv3-q6h4?
Upgrading to 2.0.1, 2.2.0, 1.2.3-0.20210314221642-a826c77dc9d2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/nats-io/jwt/v2 affected?
Yes, github.com/nats-io/jwt/v2 is affected in releases prior to 2.0.1. Upgrade your dependency to 2.0.1 or later.
Is github.com/nats-io/nats-server/v2 affected?
Yes, github.com/nats-io/nats-server/v2 is affected in releases prior to 2.2.0. Upgrade your dependency to 2.2.0 or later.
What is the CVSS score of GHSA-9r5x-fjv3-q6h4?
GHSA-9r5x-fjv3-q6h4 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with GHSA-9r5x-fjv3-q6h4?
GHSA-9r5x-fjv3-q6h4 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check Go dependencies for GHSA-9r5x-fjv3-q6h4?
Run the dependency tree command: 'inspect dependencies for github.com/nats-io/jwt/v2'. 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-9r5x-fjv3-q6h4",
  "modified" : "2024-05-21T14:35:21Z",
  "published" : "2022-02-15T01:57:18Z",
  "withdrawn" : "2024-05-21T14:35:21Z",
  "aliases" : [ ],
  "summary" : "Duplicate Advisory: Incorrect Access Control in github.com/nats-io/jwt and github.com/nats-io/nats-server/v2",
  "details" : "## Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-62mh-w5cv-p88c (for github.com/nats-io/jwt) and GHSA-j756-f273-xhp4 (for github.com/nats-io/nats-server). This link is maintained to preserve external references.\n\n## Original Description\nNATS Server (github.com/nats-io/nats-server/v2/server) 2.x before 2.2.0 and JWT library (github.com/nats-io/jwt/v2) before 2.0.1 have Incorrect Access Control because Import Token bindings are mishandled.",
  "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" : "Go",
      "name" : "github.com/nats-io/jwt/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/nats-io/nats-server/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/nats-io/jwt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.3-0.20210314221642-a826c77dc9d2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3127"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/jwt/pull/149"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/jwt/pull/149/commits/a826c77dc9d2671c961b75ceefdb439c41029866"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/nats-server/commit/423b79440c80c863de9f4e20548504e6c5d5e403"
  }, {
    "type" : "WEB",
    "url" : "https://advisories.nats.io/CVE/CVE-2021-3127.txt"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nats-io/jwt"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284", "CWE-863" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-12T20:34:10Z",
    "nvd_published_at" : "2021-03-16T20:15:00Z"
  }
}