Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS1nNnc2LXI3NmMtMjhqN80psA
Incorrect Authorization in NATS nats-server
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2022-24450.txt)
Problem Description
NATS nats-server through 2022-02-04 has Incorrect Access Control, with unchecked ability for clients to authorize into any account, because of a coding error in a long-extant experimental feature.
A client crafting the initial protocol-level handshake could, with valid credentials for any account, specify a target account and switch into it immediately. This includes any other tenant, and includes the System account which controls nats-server core operations.
For deployments not using multi-tenancy through NATS Accounts, there is still a vulnerability: normal users are able to choose to be in the System account.
An experimental feature to provide dynamically provisioned sandbox accounts was designed to allow a server administrator to turn on an option to allow clients to dynamically request a brand new account inline at connection time. This feature went nowhere, but lived on in the code and was used by a number of tests; support was never added to any client libraries or to the documentation.
A bug in handling the feature meant that if someone did in fact have valid account credentials, then they could specify any other existing account and they would be assigned into that account.
Release 2.7.2 of nats-server removes the feature.
Because of the lack of client support and absence from protocol documentation, we feel this is safe operationally as well as the safest fix for the code.
Affected versions
NATS Server
- All 2.x versions up to and including 2.7.1.
- Fixed with nats-io/nats-server: 2.7.2
- NATS Server 1.x did not have accounts.
- Docker image: nats https://hub.docker.com/_/nats
NATS Streaming Server
- All versions embedding affected NATS Server:
- Affected: v0.15.0 up to and including v0.24.0
- Fixed with nats-io/nats-streaming-server: 0.24.1
- Docker image: nats-streaming https://hub.docker.com/_/nats-streaming
Impact
Existing users could act in any account, including the System account.
Workaround
None.
Solution
Upgrade the NATS server.
Permalink: https://github.com/advisories/GHSA-g6w6-r76c-28j7JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1nNnc2LXI3NmMtMjhqN80psA
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: about 2 years ago
Updated: 8 months ago
CVSS Score: 8.8
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Identifiers: GHSA-g6w6-r76c-28j7, CVE-2022-24450
References:
- https://github.com/nats-io/nats-server/security/advisories/GHSA-g6w6-r76c-28j7
- https://nvd.nist.gov/vuln/detail/CVE-2022-24450
- https://advisories.nats.io/CVE/CVE-2022-24450.txt
- https://github.com/nats-io/nats-server/releases/tag/v2.7.2
- https://github.com/advisories/GHSA-g6w6-r76c-28j7
Blast Radius: 38.7
Affected Packages
go:github.com/nats-io/nats-server/v2
Dependent packages: 6,417Dependent repositories: 24,884
Downloads:
Affected Version Ranges: >= 2.0.0, < 2.7.2
Fixed in: 2.7.2
All affected versions: 2.0.0, 2.0.2, 2.0.4, 2.1.0, 2.1.2, 2.1.4, 2.1.6, 2.1.7, 2.1.8, 2.1.9, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.2.6, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.5.0, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.6.6, 2.7.0, 2.7.1
All unaffected versions: 2.7.2, 2.7.3, 2.7.4, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.9.4, 2.9.5, 2.9.6, 2.9.7, 2.9.8, 2.9.9, 2.9.10, 2.9.11, 2.9.12, 2.9.14, 2.9.15, 2.9.16, 2.9.17, 2.9.18, 2.9.19, 2.9.20, 2.9.21, 2.9.22, 2.9.23, 2.9.24, 2.9.25, 2.10.0, 2.10.1, 2.10.2, 2.10.3, 2.10.4, 2.10.5, 2.10.6, 2.10.7, 2.10.8, 2.10.9, 2.10.10, 2.10.11, 2.10.12, 2.10.14
go:github.com/nats-io/nats-streaming-server
Dependent packages: 4,332Dependent repositories: 1,520
Downloads:
Affected Version Ranges: >= 0.15.0, < 0.24.1
Fixed in: 0.24.1
All affected versions: 0.15.0, 0.15.1, 0.16.0, 0.16.2, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.21.0, 0.21.1, 0.21.2, 0.22.0, 0.22.1, 0.23.0, 0.23.1, 0.23.2, 0.24.0
All unaffected versions: 0.1.0, 0.2.0, 0.2.2, 0.3.0, 0.3.4, 0.3.6, 0.3.8, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.7.2, 0.9.0, 0.9.2, 0.10.0, 0.10.2, 0.11.0, 0.11.2, 0.12.0, 0.12.2, 0.14.0, 0.14.1, 0.14.2, 0.14.3, 0.24.1, 0.24.2, 0.24.3, 0.24.4, 0.24.5, 0.24.6, 0.25.0, 0.25.1, 0.25.2, 0.25.3, 0.25.4, 0.25.5, 0.25.6