GHSA-2c64-vj8g-vwrq CVE-2020-26892 GHSA-4w5x-x539-ppf5 GO-2022-0380
Incorrect handling of credential expiry by /nats-io/nats-server
- Severity
- 9.8 / 10
- Critical · CVSS 3.1
- Exploit chance (EPSS)
- 2.33%
- Chance of exploitation in the next 30 days. Higher than 83.53% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-284 Improper Access Control
- Fix
- Available
- 2 packages have a fixed version
Description
(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.
Affected versions
Go
| Package | Vulnerable | Fixed in |
|---|---|---|
| github.com/nats-io/jwt | < 1.1.0 |
1.1.0 |
| github.com/nats-io/nats-server/v2 | < 2.1.9 |
2.1.9 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
github.com/nats-io/jwt Go → 1.1.0
- go
go get github.com/nats-io/jwt@v1.1.0 && go mod tidy
github.com/nats-io/nats-server/v2 Go → 2.1.9
- go
go get github.com/nats-io/nats-server/v2@v2.1.9 && go mod tidy
Severity breakdown
CVSS 3.1 9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Weakness
CWE-284: Improper Access Control
The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.
How to prevent it
- Architecture and Design, Operation: Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software.
- Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
References
Advisories
Packages
Other links
- github.com/nats-io/nats-server/security/advisories/GHSA-2c64-vj8g-vwrq
- github.com/nats-io/jwt/commit/e11ce317263cef69619fc1ca743b195d02aa1d8a
- advisories.nats.io/CVE/CVE-2020-26892.txt
- github.com/nats-io/jwt/security/advisories/GHSA-4w5x-x539-ppf5
- github.com/nats-io/nats-server/commit/1e08b67f08e18cd844dce833a265aaa72500a12f
- github.com/nats-io/nats-server/commits/master
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VT67X…
- pkg.go.dev/vuln/GO-2022-0380
- openwall.com/lists/oss-security/2020/11/02/2
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-pq2q-rcw4-3hr6 NATS: Pre-auth remote server crash via WebSocket frame length overflow in wsRead | High | Also affects github.com/nats-io/nats-server/v2 |
| GHSA-3f24-pcvm-5jqc NATS has mTLS verify_and_map authentication bypass via incorrect Subject DN matching | Medium | Also affects github.com/nats-io/nats-server/v2 |
| GHSA-55h8-8g96-x4hj NATS: Leafnode connections allow spoofing of Nats-Request-Info identity headers | Medium | Also affects github.com/nats-io/nats-server/v2 |
| GHSA-pwx7-fx9r-hr4h NATS Server: Incomplete Stripping of Nats-Request-Info Header Allows Identity Spoofing | Medium | Also affects github.com/nats-io/nats-server/v2 |
| GHSA-9983-vrx2-fg9c NATS JetStream has an authorization bypass through its Management API | Medium | Also affects github.com/nats-io/nats-server/v2 |
| GHSA-8r68-gvr4-jh7j NATS is vulnerable to pre-auth DoS through WebSockets client service | Medium | Also affects github.com/nats-io/nats-server/v2 |
| GHSA-vprv-35vv-q339 NATS has pre-auth server panic via leafnode handling | High | Also affects github.com/nats-io/nats-server/v2 |
| GHSA-jxxm-27vp-c3m5 NATS allows MQTT clients to bypass ACL checks | Medium | Also affects github.com/nats-io/nats-server/v2 |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor