GHSA-m4jx-6526-vvhm BIT-nats-2020-28466 CVE-2020-28466 GO-2022-0855 SNYK-GOLANG-GITHUBCOMNATSIONATSSERVERSERVER-1042967
Denial of service in github.com/nats-io/nats-server/server
- Severity
- 7.5 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 3.73%
- Chance of exploitation in the next 30 days. Higher than 89.81% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-400 Uncontrolled Resource Consumption
- Fix
- Available
- 2 packages have a fixed version
Description
This affects all versions of package github.com/nats-io/nats-server/server. Untrusted accounts are able to crash the server using configs that represent a service export/import cycles. Disclaimer from the maintainers - Running a NATS service which is exposed to untrusted users presents a heightened risk. Any remote execution flaw or equivalent seriousness, or denial-of-service by unauthenticated users, will lead to prompt releases by the NATS maintainers. Fixes 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. Those who are running such services are encouraged to build regularly from git.
Affected versions
Go
| Package | Vulnerable | Fixed in |
|---|---|---|
| github.com/nats-io/nats-server | < 2.2.0 |
2.2.0 |
| github.com/nats-io/nats-server | all versions |
No fix yet |
| github.com/nats-io/nats-server/v2 | < 2.2.0 |
2.2.0 |
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/nats-server Go → 2.2.0
- go
go get github.com/nats-io/nats-server@v2.2.0 && go mod tidy
github.com/nats-io/nats-server/v2 Go → 2.2.0
- go
go get github.com/nats-io/nats-server/v2@v2.2.0 && go mod tidy
Severity breakdown
CVSS 3.1 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Weakness
CWE-400: Uncontrolled Resource Consumption
The product does not properly control the allocation and maintenance of a limited resource.
How to prevent it
- Architecture and Design: Design throttling mechanisms into the system architecture. The best protection is to limit the amount of resources that an unauthorized user can cause to be expended. A strong authentication and access control model will help prevent such attacks from occurring in the first place. The login application should be protected against DoS attacks as much as possible. Limiting the database access, perhaps by caching result sets, can help minimize the resources expended. To further limit the potential for a DoS attack, consider tracking the rate of requests received from users and blocking requests that exceed a defined rate threshold.
- Architecture and Design: Mitigation of resource exhaustion attacks requires that the target system either: recognizes the attack and denies that user further access for a given amount of time, or uniformly throttles all requests in order to make it more difficult to consume resources more quickly than they can again be freed. The first of these solutions is an issue in itself though, since it may allow attackers to prevent the use of the system by a particular valid user. If the attacker impersonates the valid user, they may be able to prevent the user from accessing the server in question. The second solution is simply difficult to effectively institute -- and even when properly done, it does not provide a full solution. It simply makes the attack require more resources on the part of the attacker.
- Architecture and Design: Ensure that protocols have specific limits of scale placed on them.
- Implementation: Ensure that all failures in resource allocation place the system into a safe posture.
References
Advisories
Other links
- github.com/nats-io/nats-server/pull/1731
- github.com/nats-io/nats-server/pull/1731/commits/2e3c22672936f4980d343fb1d328b3…
- pkg.go.dev/vuln/GO-2022-0855
- snyk.io/vuln/SNYK-GOLANG-GITHUBCOMNATSIONATSSERVERSERVER-1042967
- openwall.com/lists/oss-security/2021/03/16/1
- openwall.com/lists/oss-security/2021/03/16/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 |
| 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 |
| GHSA-55h8-8g96-x4hj NATS: Leafnode connections allow spoofing of Nats-Request-Info identity headers | Medium | Also affects github.com/nats-io/nats-server |
| 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 |
| GHSA-9983-vrx2-fg9c NATS JetStream has an authorization bypass through its Management API | Medium | Also affects github.com/nats-io/nats-server |
| GHSA-8r68-gvr4-jh7j NATS is vulnerable to pre-auth DoS through WebSockets client service | Medium | Also affects github.com/nats-io/nats-server |
| GHSA-vprv-35vv-q339 NATS has pre-auth server panic via leafnode handling | High | Also affects github.com/nats-io/nats-server |
| GHSA-jxxm-27vp-c3m5 NATS allows MQTT clients to bypass ACL checks | Medium | Also affects github.com/nats-io/nats-server |
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