CVE-2026-43974: gun Package Vulnerability Leading to Raw Protocol Mode Exploitation

gun Updated 01 Aug 2026

Summary

08/06/2026
Yes i
High
8.7

CVE-2026-43974: gun has an Unexpected Status Code or Return Value vulnerability. Affects gun versions >= 2.0.0, < 2.4.0. Fixed in 2.4.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The gun package is a popular HTTP client library in the Elixir ecosystem, designed for handling WebSocket and HTTP requests efficiently. It provides features such as connection management, message handling, and protocol upgrades. However, it is vulnerable to a specific issue that allows malicious servers to exploit the client by sending unsolicited protocol upgrade responses, leading to potential denial of service.

Vulnerability Detail

The vulnerability arises from the gun_http module's inability to properly validate the Upgrade and Connection headers when receiving a 101 Switching Protocols response over HTTP/1.1. This oversight allows any HTTP server to send an unsolicited 101 response, forcing the gun client into raw protocol mode. In this mode, the client loses HTTP framing, and the server can flood the client with arbitrary data, overwhelming its mailbox and memory, ultimately crashing the VM. This vulnerability affects gun versions from 2.0.0 to before 2.4.0.

How To Fix

Latest published version: 2.7.0 as of 23 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.4.0

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can implement additional validation on the client-side to ignore unsolicited 101 responses. However, this is not a complete solution and should not replace updating to the patched version.

Conclusion

The gun package has a significant vulnerability (CVE-2026-43974) that can be exploited by malicious servers, leading to potential denial of service. It is crucial to update to version 2.4.0 or later to mitigate this risk. Users are encouraged to monitor their applications for vulnerabilities using tools like Vulert.

See every vulnerability recorded for gun →

Share this vulnerability

FAQ

CVE-2026-43974 is a vulnerability in the gun package that allows a malicious HTTP server to force the client into raw protocol mode, potentially leading to denial of service.

The vulnerability affects gun versions from 2.0.0 to before 2.4.0.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The CVSS score of this vulnerability is 8.7, indicating a high severity level.

If you cannot update the package right away, consider implementing additional validation to ignore unsolicited 101 responses as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for gun.

How To Fix

Latest published version: 2.7.0 as of 23 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.4.0

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback