{"id":"CVE-2026-43974","state":"PUBLISHED","title":"gun HTTP/1.1 client accepts unsolicited 101 Switching Protocols response allowing server-driven protocol hijack and OOM","description":"Unexpected Status Code or Return Value vulnerability in ninenines gun (gun_http module) allows a malicious HTTP server to force the client into raw protocol mode via an unsolicited 101 Switching Protocols response.\n\nIn gun_http:handle_inform/8, when a 101 Switching Protocols response is received over HTTP/1.1, the function verifies only that the Upgrade header is syntactically valid and that the stream reference is a plain reference(). It does not check whether the client ever sent an Upgrade or Connection: upgrade header on the corresponding request. Because this check is absent, any 101 response (solicited or not) causes gun to dispatch a gun_upgrade message to the caller and transition the entire connection to raw protocol mode.\n\nA malicious or compromised HTTP server can send an unsolicited 101 response to any HTTP/1.1 request, causing the gun client to abandon HTTP framing for that connection. Once in raw mode, gun_raw applies no flow control (flow=infinity) and re-arms socket active mode after every received packet, so the server can flood the client with arbitrary bytes. These are forwarded as unbounded gun_data messages to the owner process, exhausting its mailbox and BEAM memory, ultimately crashing the VM.\n\nThis issue affects gun: from 2.0.0 before 2.4.0.","publishedAt":"2026-06-08T14:12:36.957Z","updatedAt":"2026-06-08T16:34:38.989Z","severity":{"score":8.7,"label":"High","version":"4.0","vector":"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","source":"EEF"},"assigner":"EEF","products":["ninenines gun"],"affected":[{"vendor":"ninenines","product":"gun","packageName":"gun","packageURL":"pkg:hex/gun","defaultStatus":"unaffected","versions":[{"version":"2.0.0","status":"affected","lessThan":"2.4.0","versionType":"semver"}],"cpes":["cpe:2.3:a:ninenines:gun:*:*:*:*:*:*:*:*"],"modules":["gun_http"],"programFiles":["src/gun_http.erl"],"programRoutines":[{"name":"gun_http:handle_inform/8"}],"repo":"https://github.com/ninenines/gun"},{"vendor":"ninenines","product":"gun","packageName":"ninenines/gun","packageURL":"pkg:github/ninenines/gun","defaultStatus":"unaffected","versions":[{"version":"a3c2edbb8c807717e2f10520c6cf1e77a62eab2e","status":"affected","lessThan":"5b48068c29ce5e112cb149b5857c7d4dc319a81b","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:ninenines:gun:*:*:*:*:*:*:*:*"],"modules":["gun_http"],"programFiles":["src/gun_http.erl"],"programRoutines":[{"name":"gun_http:handle_inform/8"}],"repo":"https://github.com/ninenines/gun.git"}],"references":["https://cna.erlef.org/cves/CVE-2026-43974.html","https://osv.dev/vulnerability/EEF-CVE-2026-43974","https://github.com/ninenines/gun/commit/5b48068c29ce5e112cb149b5857c7d4dc319a81b"],"weaknesses":["CWE-841"],"ingestedAt":"2026-10-29T20:11:57.932Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/43xxx/CVE-2026-43974.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-43974","state":"PUBLISHED","datePublished":"2026-06-08T14:12:36.957Z","dateUpdated":"2026-06-08T16:34:38.989Z","assignerShortName":"EEF","assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateReserved":"2026-05-04T18:23:25.574Z"},"containers":{"cna":{"title":"gun HTTP/1.1 client accepts unsolicited 101 Switching Protocols response allowing server-driven protocol hijack and OOM","descriptions":[{"lang":"en","value":"Unexpected Status Code or Return Value vulnerability in ninenines gun (gun_http module) allows a malicious HTTP server to force the client into raw protocol mode via an unsolicited 101 Switching Protocols response.\n\nIn gun_http:handle_inform/8, when a 101 Switching Protocols response is received over HTTP/1.1, the function verifies only that the Upgrade header is syntactically valid and that the stream reference is a plain reference(). It does not check whether the client ever sent an Upgrade or Connection: upgrade header on the corresponding request. Because this check is absent, any 101 response (solicited or not) causes gun to dispatch a gun_upgrade message to the caller and transition the entire connection to raw protocol mode.\n\nA malicious or compromised HTTP server can send an unsolicited 101 response to any HTTP/1.1 request, causing the gun client to abandon HTTP framing for that connection. Once in raw mode, gun_raw applies no flow control (flow=infinity) and re-arms socket active mode after every received packet, so the server can flood the client with arbitrary bytes. These are forwarded as unbounded gun_data messages to the owner process, exhausting its mailbox and BEAM memory, ultimately crashing the VM.\n\nThis issue affects gun: from 2.0.0 before 2.4.0."}],"affected":[{"vendor":"ninenines","product":"gun","packageName":"gun","packageURL":"pkg:hex/gun","defaultStatus":"unaffected","versions":[{"version":"2.0.0","status":"affected","lessThan":"2.4.0","versionType":"semver"}],"cpes":["cpe:2.3:a:ninenines:gun:*:*:*:*:*:*:*:*"],"modules":["gun_http"],"programFiles":["src/gun_http.erl"],"programRoutines":[{"name":"gun_http:handle_inform/8"}],"repo":"https://github.com/ninenines/gun"},{"vendor":"ninenines","product":"gun","packageName":"ninenines/gun","packageURL":"pkg:github/ninenines/gun","defaultStatus":"unaffected","versions":[{"version":"a3c2edbb8c807717e2f10520c6cf1e77a62eab2e","status":"affected","lessThan":"5b48068c29ce5e112cb149b5857c7d4dc319a81b","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:ninenines:gun:*:*:*:*:*:*:*:*"],"modules":["gun_http"],"programFiles":["src/gun_http.erl"],"programRoutines":[{"name":"gun_http:handle_inform/8"}],"repo":"https://github.com/ninenines/gun.git"}],"references":[{"url":"https://cna.erlef.org/cves/CVE-2026-43974.html","tags":["related","third-party-advisory"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-43974","tags":["related"]},{"url":"https://github.com/ninenines/gun/commit/5b48068c29ce5e112cb149b5857c7d4dc319a81b","tags":["patch"]}],"metrics":[{"cvssV4_0":{"attackComplexity":"LOW","attackRequirements":"NONE","attackVector":"NETWORK","baseScore":8.7,"baseSeverity":"HIGH","privilegesRequired":"NONE","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","vectorString":"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","version":"4.0","vulnAvailabilityImpact":"HIGH","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-841","description":"CWE-841 Improper Enforcement of Behavioral Workflow","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"EEF","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateUpdated":"2026-06-08T16:34:38.989Z"},"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:ninenines:gun:*:*:*:*:*:*:*:*","versionEndExcluding":"2.4.0","versionStartIncluding":"2.0.0","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"finder","value":"Peter Ullrich"},{"lang":"en","type":"remediation developer","value":"Loïc Hoguin"}],"impacts":[{"capecId":"CAPEC-220","descriptions":[{"lang":"en","value":"CAPEC-220 Client-Server Protocol Manipulation"}]},{"capecId":"CAPEC-130","descriptions":[{"lang":"en","value":"CAPEC-130 Excessive Allocation"}]}],"source":{"discovery":"EXTERNAL"},"x_generator":{"engine":"cvelib 1.8.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-06-08T15:41:42.657559Z","id":"CVE-2026-43974","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-06-08T15:41:49.498Z"}}]}}}