Vulnerabilities in pkg:golang/github.com/nats-io/nats-streaming-server
PACKAGECVE-2022-29946 is a HIGH (CVSS 6.5) remote code execution vulnerability (CWE-863: Incorrect Authorization) affecting Github.com/nats io/nats server/v2 libraries in the Go ecosystem. The issue involves nats server and streaming server fails to enforce negative user permissions, may allow denied subjects. Remediation is available by upgrading affected packages to version 2.8.2, 0.24.6.
pkg:golang/github.com/nats-io/nats-streaming-server
Vulnerability advisories affecting package pkg:golang/github.com/nats-io/nats-streaming-server. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-2h2x-8hh2-mfq8 | CVE-2022-29946 | HIGH | NATS Server and Streaming Server fails to enforce negative user permissions, may allow denied subjects |
| GHSA-g6w6-r76c-28j7 | CVE-2022-24450 | HIGH | Incorrect Authorization in NATS nats-server |
| GHSA-6h3m-36w8-hv68 | CVE-2022-26652 | HIGH | Arbitrary file write in nats-server |
CVE-2022-29946 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2022-29946
To remediate this vulnerability, upgrade all affected Github.com/nats io/nats server/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/nats-io/nats-server/v2 to 2.8.2
Upgrade github.com/nats-io/nats-streaming-server to 0.24.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/nats-io/nats-server/v2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-29946, inspect your project dependencies for Github.com/nats io/nats server/v2:
inspect dependencies for github.com/nats-io/nats-server/v2
Analyze the terminal output to locate any version of Github.com/nats io/nats server/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Github.com/nats io/nats server/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-29946 Affected Github.com/nats io/nats server/v2 Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/nats-io/nats-server/v2
|
Go |
< 2.8.2
|
2.8.2
|
|
github.com/nats-io/nats-streaming-server
|
Go |
< 0.24.6
|
0.24.6
|
References
Frequently Asked Questions
What is CVE-2022-29946?
Which Github.com/nats io/nats server/v2 versions are affected?
What version fixes CVE-2022-29946?
Is github.com/nats-io/nats-server/v2 affected?
Is github.com/nats-io/nats-streaming-server affected?
What is the CVSS score of CVE-2022-29946?
What CWE is associated with CVE-2022-29946?
How can I check Go dependencies for CVE-2022-29946?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2h2x-8hh2-mfq8",
"modified" : "2024-10-30T18:50:03Z",
"published" : "2024-07-11T21:31:12Z",
"aliases" : [ "CVE-2022-29946" ],
"summary" : "NATS Server and Streaming Server fails to enforce negative user permissions, may allow denied subjects",
"details" : "NATS.io NATS Server before 2.8.2 and Streaming Server before 0.24.6 could allow a remote attacker to bypass security restrictions, caused by the failure to enforce negative user permissions in one scenario. By using a queue subscription on the wildcard, an attacker could exploit this vulnerability to allow denied subjects.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/nats-io/nats-server/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.8.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/nats-io/nats-streaming-server"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.24.6"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-29946"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-2h2x-8hh2-mfq8"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/advisories/blob/main/CVE/CVE-2022-29946.txt"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-863" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-07-12T14:01:30Z",
"nvd_published_at" : "2024-07-11T21:15:10Z"
}
}