7.5high
Nil dereference in NATS JWT, DoS of nats-server
- Severity
- 7.5high CVSS:3.1 by NVD
- Exploit likelihood
- 2.16% (higher than 82% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-h2fg-54x9-5qhqGHSA-hmm9-r2m2-qg9wGO-2022-0402
Description
The JWT library in NATS nats-server before 2.1.9 allows a denial of service (a nil dereference in Go code).
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| github.com/nats-io/jwt (Go) | before 1.1.0 | GitHub Advisory Database, Go Vulnerability Database |
| github.com/nats-io/nats-server/v2 (Go) | before 2.1.9 | GitHub Advisory Database |
| linuxfoundation nats-server | before 2.1.9 | NVD |
| fedoraproject fedora | 33 | NVD |
All scores
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
Classification
What each source says
CVE List
The JWT library in NATS nats-server before 2.1.9 allows a denial of service (a nil dereference in Go code).
GitHub Advisory Database
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.
GitHub Advisory Database
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2020-26521.txt)
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.
Go Vulnerability Database
A malicious account can create and sign a User JWT which causes a panic when decoded by the NATS JWT library.
NVD (es)
La biblioteca JWT en NATS nats-server versiones anteriores a 2.1.9, permite una denegación de servicio (una desreferencia nil en el código Go)
References
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2020-26521 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-h2fg-54x9-5qhq changed 2026-09-10 | CC-BY-4.0 |
| GitHub Advisory Database | GHSA-hmm9-r2m2-qg9w changed 2026-09-10 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2022-0402 changed 2026-02-04 | CC-BY-4.0 |
| NVD | CVE-2020-26521 changed 2026-06-17 | Public domain |