GHSA-gwj5-3vfq-q992: Github.com/nats io/nats server/v2 Denial of Service Vulnerability
LOWGHSA-gwj5-3vfq-q992 is a LOW (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Github.com/nats io/nats server/v2 libraries in the Go ecosystem. The issue involves import loops in account imports, nats-server dos. Remediation is available by upgrading affected packages to version 2.2.0.
GHSA-gwj5-3vfq-q992 at a Glance
Security Impact
CVSS: 7.5
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:N/I:N/A:H).
How to Fix GHSA-gwj5-3vfq-q992
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.2.0
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 GHSA-gwj5-3vfq-q992, 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.2.0), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. 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
GHSA-gwj5-3vfq-q992 Affected Github.com/nats io/nats server/v2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/nats-io/nats-server/v2
|
Go |
< 2.2.0
|
2.2.0
|
References
Frequently Asked Questions
What is GHSA-gwj5-3vfq-q992?
Which Github.com/nats io/nats server/v2 versions are affected?
What version fixes GHSA-gwj5-3vfq-q992?
Is github.com/nats-io/nats-server/v2 affected?
What is the CVSS score of GHSA-gwj5-3vfq-q992?
What CWE is associated with GHSA-gwj5-3vfq-q992?
How can I check Go dependencies for GHSA-gwj5-3vfq-q992?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gwj5-3vfq-q992",
"modified" : "2021-05-20T21:07:16Z",
"published" : "2021-05-21T16:22:16Z",
"aliases" : [ ],
"summary" : "Import loops in account imports, nats-server DoS",
"details" : "(This advisory is canonically <https://advisories.nats.io/CVE/CVE-2020-28466.txt>)\n\n## Problem Description\n\nAn export/import cycle between accounts could crash the nats-server, after consuming CPU and memory.\n\nThis issue was fixed publicly in <https://github.com/nats-io/nats-server/pull/1731> in November 2020.\n\nThe need to call this out as a security issue was highlighted by `snyk.io` and we are grateful for their assistance in doing so.\n\nOrganizations which run a NATS service providing access to accounts run by untrusted third parties are affected.\nSee below for an important caveat if running such a service.\n\n\n## Affected versions\n\n#### NATS Server\n\n * Version 2 prior to 2.2.0\n + 2.0.0 through and including 2.1.9 are vulnerable.\n * fixed with nats-io/nats-server PR 1731, commit 2e3c226729\n\n\n## Impact\n\nThe nats-server could be killed, after consuming resources.\n\n\n## Workaround\n\nThe import cycle requires at least two accounts to work; if you have open account sign-up, then restricting new account sign-up might hinder an attacker.\n\n\n## Solution\n\nUpgrade the nats-server.\n\n\n## Caveat on NATS with untrusted users\n\nRunning a NATS service which is exposed to untrusted users presents a heightened risk.\n\nAny remote execution flaw or equivalent seriousness, or denial-of-service by unauthenticated users, will lead to prompt releases by the NATS maintainers.\n\nFixes for denial of service issues with no threat of remote execution, when limited to account holders, are likely to just be committed to the main development branch with no special attention.\n\nThose who are running such services are encouraged to build regularly from git.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/nats-io/nats-server/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.2.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/nats-io/nats-server/security/advisories/GHSA-gwj5-3vfq-q992"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2021-05-20T21:07:16Z",
"nvd_published_at" : null
}
}