CVE-2022-28357: Github.com/nats io/nats server Path Traversal Vulnerability
CRITICALCVE-2022-28357 is a CRITICAL (CVSS 9.8) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Github.com/nats io/nats server libraries in the Go ecosystem. The issue involves nats nats-server allows directory traversal via unintended path to a management action. Remediation is available by upgrading affected packages to version 2.7.4.
CVE-2022-28357 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-28357
To remediate this vulnerability, upgrade all affected Github.com/nats io/nats server 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 to 2.7.4
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
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-28357, inspect your project dependencies for Github.com/nats io/nats server:
inspect dependencies for github.com/nats-io/nats-server
Analyze the terminal output to locate any version of Github.com/nats io/nats server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.7.4), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Github.com/nats io/nats server, 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-28357 Affected Github.com/nats io/nats server Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/nats-io/nats-server
|
Go |
≥ 2.2.0
< 2.7.4
|
2.7.4
|
References
Frequently Asked Questions
What is CVE-2022-28357?
Which Github.com/nats io/nats server versions are affected?
What version fixes CVE-2022-28357?
Is github.com/nats-io/nats-server affected?
What is the CVSS score of CVE-2022-28357?
What CWE is associated with CVE-2022-28357?
How can I check Go dependencies for CVE-2022-28357?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vpjc-4jcv-jc29",
"modified" : "2023-09-21T17:09:04Z",
"published" : "2023-09-19T03:30:34Z",
"aliases" : [ "CVE-2022-28357" ],
"summary" : "NATS nats-server allows directory traversal via unintended path to a management action ",
"details" : "NATS nats-server 2.2.0 through 2.7.4 allows directory traversal because of an unintended path to a management action from a management account.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/nats-io/nats-server"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.2.0"
}, {
"fixed" : "2.7.4"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-28357"
}, {
"type" : "WEB",
"url" : "https://advisories.nats.io/CVE/CVE-2022-28357.txt"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nats-io/nats-server"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/releases/tag/v2.7.4"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2023-09-21T17:09:04Z",
"nvd_published_at" : "2023-09-19T02:15:54Z"
}
}