GHSA-2c64-vj8g-vwrq

Suggest an improvement
Source
https://github.com/advisories/GHSA-2c64-vj8g-vwrq
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/05/GHSA-2c64-vj8g-vwrq/GHSA-2c64-vj8g-vwrq.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-2c64-vj8g-vwrq
Aliases
Related
Published
2021-05-21T16:11:49Z
Modified
2023-11-01T04:52:48.435112Z
Summary
Incorrect handling of credential expiry by /nats-io/nats-server
Details

(This advisory is canonically https://advisories.nats.io/CVE/CVE-2020-26892.txt )

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.

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-284"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2021-05-20T22:19:22Z"
}
References

Affected packages

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

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