GHSA-h2fg-54x9-5qhq

Suggest an improvement
Source
https://github.com/advisories/GHSA-h2fg-54x9-5qhq
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/02/GHSA-h2fg-54x9-5qhq/GHSA-h2fg-54x9-5qhq.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-h2fg-54x9-5qhq
Aliases
Related
Published
2022-02-11T23:43:13Z
Modified
2023-11-01T04:52:47.457231Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
Nil dereference in NATS JWT, DoS of nats-server
Details

Problem Description

The NATS account system has an Operator trusted by the servers, which signs Accounts, and each Account can then create and sign Users within their account. The Operator should be able to safely issue Accounts to other entities which it does not fully trust.

A malicious Account could create and sign a User JWT with a state not created by the normal tooling, such that decoding by the NATS JWT library (written in Go) would attempt a nil dereference, aborting execution.

The NATS Server is known to be impacted by this.

Affected versions

JWT library

  • all versions prior to 1.1.0

NATS Server

  • Version 2 prior to 2.1.9

Impact

JWT library

  • Programs would nil dereference and panic, aborting execution by default.

NATS server

  • Denial of Service caused by process termination

Workaround

If your NATS servers do not trust any accounts which are managed by untrusted entities, then malformed User credentials are unlikely to be encountered.

Solution

Upgrade the JWT dependency in any application using it.

Upgrade the NATS server if using NATS Accounts.

Database specific
{
    "nvd_published_at": "2020-11-06T08:15:00Z",
    "cwe_ids": [
        "CWE-476"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2021-05-21T21:32:02Z"
}
References

Affected packages

Go / github.com/nats-io/jwt

Package

Name
github.com/nats-io/jwt
View open source insights on deps.dev
Purl
pkg:golang/github.com/nats-io/jwt

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.1.0

Go / github.com/nats-io/nats-server/v2

Package

Name
github.com/nats-io/nats-server/v2
View open source insights on deps.dev
Purl
pkg:golang/github.com/nats-io/nats-server/v2

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.1.9