CVE-2026-43973: Gun Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-r53j-fjj5-mv77
CWE-770
Published
Advisory Summary

CVE-2026-43973 is a HIGH remote code execution vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Gun libraries in the Hex ecosystem. The issue involves gun has an uncontrolled resource consumption vulnerability. Remediation is available by upgrading affected packages to version 2.4.0.

CVE-2026-43973 at a Glance

CVE Identifier CVE-2026-43973
GHSA Identifier GHSA-r53j-fjj5-mv77
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product Gun
Package Ecosystem Hex
Published Date
Last Updated

How to Fix CVE-2026-43973

To remediate this vulnerability, upgrade all affected Gun dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

gun fixed: 2.4.0
Upgrade gun to 2.4.0
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 gun

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-43973, inspect your project dependencies for Gun:

inspect dependencies for gun

Analyze the terminal output to locate any version of Gun in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.4.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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Gun, 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

Uncontrolled Resource Consumption vulnerability in ninenines gun (gun_http module) allows a malicious server to exhaust client memory via unbounded HTTP/1.1 response buffering. In gun_http:handle/5, three clauses accumulate incoming TCP data into the connection's buffer field using binary concatenation with no upper-bound check: the head clause appends data until the \r\n\r\n header terminator is found; the body_chunked clause appends data whenever cow_http_te:stream_chunked/2 returns a more result indicating an incomplete chunk boundary; and the body_trailer clause appends data until the trailing \r\n\r\n is found. In each case, when the expected terminator never arrives, the enlarged binary is stored back into state and the process waits for more data, with no configurable or hard-coded ceiling on buffer size. A malicious or compromised server can exploit this by sending a partial response that never completes. For example, a response may begin with HTTP/1.1 200 OK\r\nX-Pad: followed by an unbounded stream of arbitrary bytes, never sending the header terminator. The gun connection process will continuously append the incoming data to its buffer, causing unbounded heap growth. Because BEAM imposes no per-process heap limit by default, a single malicious connection can exhaust all available memory on the node, causing a node-wide out-of-memory crash. This issue affects gun: from 1.0.0 before 2.4.0.

CVE-2026-43973 Affected Gun Versions

1 component(s)
Fixed Versions:
2.4.0
Product / Package Ecosystem Affected Versions Fixed Version
gun
Hex
≥ 1.0.0
< 2.4.0
2.4.0

References

Frequently Asked Questions

What is CVE-2026-43973?
CVE-2026-43973 is a security vulnerability in Gun involving gun has an Uncontrolled Resource Consumption vulnerability under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Gun versions are affected?
Affected versions include releases prior to 2.4.0 across affected packages: gun.
What version fixes CVE-2026-43973?
Upgrading to 2.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gun affected?
Yes, gun is affected in releases prior to 2.4.0. Upgrade your dependency to 2.4.0 or later.
What CWE is associated with CVE-2026-43973?
CVE-2026-43973 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check Hex dependencies for CVE-2026-43973?
Run the dependency tree command: 'inspect dependencies for gun'. 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-r53j-fjj5-mv77",
  "modified" : "2026-07-29T15:45:14Z",
  "published" : "2026-06-08T15:33:00Z",
  "aliases" : [ "CVE-2026-43973" ],
  "summary" : "gun has an Uncontrolled Resource Consumption vulnerability",
  "details" : "Uncontrolled Resource Consumption vulnerability in ninenines gun (gun_http module) allows a malicious server to exhaust client memory via unbounded HTTP/1.1 response buffering.\n\nIn gun_http:handle/5, three clauses accumulate incoming TCP data into the connection's buffer field using binary concatenation with no upper-bound check: the head clause appends data until the \\r\\n\\r\\n header terminator is found; the body_chunked clause appends data whenever cow_http_te:stream_chunked/2 returns a more result indicating an incomplete chunk boundary; and the body_trailer clause appends data until the trailing \\r\\n\\r\\n is found. In each case, when the expected terminator never arrives, the enlarged binary is stored back into state and the process waits for more data, with no configurable or hard-coded ceiling on buffer size.\n\nA malicious or compromised server can exploit this by sending a partial response that never completes. For example, a response may begin with HTTP/1.1 200 OK\\r\\nX-Pad:  followed by an unbounded stream of arbitrary bytes, never sending the header terminator. The gun connection process will continuously append the incoming data to its buffer, causing unbounded heap growth. Because BEAM imposes no per-process heap limit by default, a single malicious connection can exhaust all available memory on the node, causing a node-wide out-of-memory crash.\n\nThis issue affects gun: from 1.0.0 before 2.4.0.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Hex",
      "name" : "gun"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "2.4.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-43973"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ninenines/gun/commit/f3e7e0568b3c4cf9fa4bea79d5116e67ce76ad25"
  }, {
    "type" : "WEB",
    "url" : "https://cna.erlef.org/cves/CVE-2026-43973.html"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ninenines/gun"
  }, {
    "type" : "WEB",
    "url" : "https://osv.dev/vulnerability/EEF-CVE-2026-43973"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-29T15:45:14Z",
    "nvd_published_at" : "2026-06-08T15:16:46Z"
  }
}