CVE-2026-27571: Github.com/nats io/nats server/v2 Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-qrvq-68c2-7grw
CVSS 5.9
CWE-409 CWE-770
Published
Advisory Summary

CVE-2026-27571 is a MODERATE (CVSS 5.9) denial of service vulnerability (CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)) affecting Github.com/nats io/nats server/v2 libraries in the Go ecosystem. The issue involves nats-server websockets are vulnerable to pre-auth memory dos. Remediation is available by upgrading affected packages to version 2.11.12, 2.12.3.

CVE-2026-27571 at a Glance

CVE Identifier CVE-2026-27571
GHSA Identifier GHSA-qrvq-68c2-7grw
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)
Affected Product Github.com/nats io/nats server/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-27571

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.

github.com/nats-io/nats-server/v2 fixed: 2.11.12
Upgrade github.com/nats-io/nats-server/v2 to 2.11.12
github.com/nats-io/nats-server/v2 fixed: 2.12.3
Upgrade github.com/nats-io/nats-server/v2 to 2.12.3
github.com/nats-io/nats-server fixed: Latest secure release
Upgrade github.com/nats-io/nats-server to Latest secure release
Verify Direct and Transitive Dependencies

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-2026-27571, 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.11.12), 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-409: Improper Handling of Highly Compressed Data (Data Amplification), where the product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output. 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

### Impact The WebSockets handling of NATS messages handles compressed messages via the WebSockets negotiated compression. The implementation bound the memory size of a NATS message but did not independently bound the memory consumption of the memory stream when constructing a NATS message which might then fail validation for size reasons. An attacker can use a compression bomb to cause excessive memory consumption, often resulting in the operating system terminating the server process. The use of compression is negotiated before authentication, so this does not require valid NATS credentials to exploit. The fix was to bounds the decompression to fail once the message was too large, instead of continuing on. ### Patches This was released in nats-server without being highlighted as a security issue. It should have been, this was an oversight. Per the NATS security policy, because this does not require a valid user, it is CVE-worthy. This was fixed in the v2.11 series with v2.11.12 and in the v2.12 series with v2.12.3. ### Workarounds This only affects deployments which use WebSockets and which expose the network port to untrusted end-points. ### References This was reported to the NATS maintainers by Pavel Kohout of Aisle Research (www.aisle.com).

CVE-2026-27571 Affected Github.com/nats io/nats server/v2 Versions

3 component(s)
Fixed Versions:
2.11.122.12.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/nats-io/nats-server/v2
Go
< 2.11.12
2.11.12
github.com/nats-io/nats-server/v2
Go
≥ 2.12.0-RC.1
< 2.12.3
2.12.3
github.com/nats-io/nats-server
Go
≤ 1.4.1

References

Frequently Asked Questions

What is CVE-2026-27571?
CVE-2026-27571 is a security vulnerability in Github.com/nats io/nats server/v2 involving nats-server websockets are vulnerable to pre-auth memory DoS under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification).
Which Github.com/nats io/nats server/v2 versions are affected?
Affected versions include releases prior to 2.11.12, 2.12.3 across affected packages: github.com/nats-io/nats-server/v2, github.com/nats-io/nats-server.
What version fixes CVE-2026-27571?
Upgrading to 2.11.12, 2.12.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/nats-io/nats-server/v2 affected?
Yes, github.com/nats-io/nats-server/v2 is affected in releases prior to 2.11.12, 2.12.3. Upgrade your dependency to 2.11.12, 2.12.3 or later.
Is github.com/nats-io/nats-server affected?
Yes, github.com/nats-io/nats-server is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-27571?
CVE-2026-27571 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-27571?
CVE-2026-27571 is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification) (The product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.).
How can I check Go dependencies for CVE-2026-27571?
Run the dependency tree command: 'inspect dependencies for github.com/nats-io/nats-server/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qrvq-68c2-7grw",
  "modified" : "2026-02-27T20:03:26Z",
  "published" : "2026-02-24T16:04:53Z",
  "aliases" : [ "CVE-2026-27571" ],
  "summary" : "nats-server websockets are vulnerable to pre-auth memory DoS",
  "details" : "### Impact\n\nThe WebSockets handling of NATS messages handles compressed messages via the WebSockets negotiated compression.  The implementation bound the memory size of a NATS message but did not independently bound the memory consumption of the memory stream when constructing a NATS message which might then fail validation for size reasons.\n\nAn attacker can use a compression bomb to cause excessive memory consumption, often resulting in the operating system terminating the server process.\n\nThe use of compression is negotiated before authentication, so this does not require valid NATS credentials to exploit.\n\nThe fix was to bounds the decompression to fail once the message was too large, instead of continuing on.\n\n### Patches\n\nThis was released in nats-server without being highlighted as a security issue.  It should have been, this was an oversight.  Per the NATS security policy, because this does not require a valid user, it is CVE-worthy.\n\nThis was fixed in the v2.11 series with v2.11.12 and in the v2.12 series with v2.12.3.\n\n### Workarounds\n\nThis only affects deployments which use WebSockets and which expose the network port to untrusted end-points.\n\n### References\n\nThis was reported to the NATS maintainers by Pavel Kohout of Aisle Research (www.aisle.com).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/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.11.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/nats-io/nats-server/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.12.0-RC.1"
      }, {
        "fixed" : "2.12.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/nats-io/nats-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.4.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/nats-server/security/advisories/GHSA-qrvq-68c2-7grw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27571"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/nats-server/commit/f77fb7c4535e6727cc1a2899cd8e6bbdd8ba2017"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nats-io/nats-server"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/nats-server/releases/tag/v2.11.12"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nats-io/nats-server/releases/tag/v2.12.3"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2026-4533"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-409", "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-24T16:04:53Z",
    "nvd_published_at" : "2026-02-24T17:29:03Z"
  }
}