# CVE-2026-39804: WebSocket permessage-deflate inflate has no output-size cap in bandit

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.2
- **CVSS:** 8.2 (v4.0, CNA) `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Attack requirements: Present; Privileges required: None; User interaction: None; Confidentiality impact: None; Integrity impact: None; Availability impact: High; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.67% (percentile 47, 2026-11-26)
- **CWE:** CWE-770
- **Published:** 2026-05-01T20:34:24.604Z
- **Modified:** 2026-11-20T05:18:54.833Z

## Who should check

- Anyone running mtrudel bandit \>= 0.5.9, \< 1.11.0
- Anyone running mtrudel bandit \>= da4027cff7d2b80319e76fe7a32f84beceec490a, \< 8156921a51e684a951221da7bc30a70a022f722e

## Description

Allocation of Resources Without Limits or Throttling vulnerability in mtrudel bandit allows unauthenticated remote denial of service via memory exhaustion when WebSocket permessage-deflate compression is enabled.

Bandit.WebSocket.PerMessageDeflate.inflate/2 in lib/bandit/websocket/permessage\_deflate.ex calls :zlib.inflate/2 with no output-size cap, then materializes the entire decompressed payload as a single binary via IO.iodata\_to\_binary/1. The websocket\_options.max\_frame\_size option only bounds the on-the-wire (compressed) frame size, not the decompressed output. A high-ratio compressed frame (e.g. uniform data at ~1024:1 ratio) can stay well under any wire-size limit while forcing GiB-scale heap allocations in the connection process before any application code runs.

An unauthenticated attacker who can open a WebSocket connection can send a single such frame to exhaust the BEAM node's memory and trigger an OOM kill.

This vulnerability requires both Bandit's server-level websocket\_options.compress and the per-upgrade compress: true option passed to WebSockAdapter.upgrade/4 to be enabled. Stock Phoenix and LiveView applications are not affected as they default to compress: false.

This issue affects bandit: from 0.5.9 before 1.11.0.

## Affected and fixed versions

- mtrudel bandit: \>= 0.5.9, \< 1.11.0 (cvelist)
- mtrudel bandit: \>= da4027cff7d2b80319e76fe7a32f84beceec490a, \< 8156921a51e684a951221da7bc30a70a022f722e (cvelist)

## Mitigation

- Upgrade bandit to 1.11.0 or later.
- Upgrade bandit to 8156921a51e684a951221da7bc30a70a022f722e or later.
- Vendor workaround: Do not pass compress: true to WebSockAdapter.upgrade/4. Omitting this option (or setting it to false) prevents permessage-deflate from being negotiated, so the inflate path is never reached.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-39804. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-39804.md
Affected: mtrudel bandit >= 0.5.9, < 1.11.0; mtrudel bandit >= da4027cff7d2b80319e76fe7a32f84beceec490a, < 8156921a51e684a951221da7bc30a70a022f722e
Fixed in: mtrudel bandit 1.11.0, mtrudel bandit 8156921a51e684a951221da7bc30a70a022f722e

Steps:
1. Search this machine and project for mtrudel bandit: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-39804 being exploited?

There is no confirmed exploitation: CVE-2026-39804 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.67% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-39804?

High: CVSS 8.2 (v4.0, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2026-39804?

mtrudel bandit \>= 0.5.9, \< 1.11.0; mtrudel bandit \>= da4027cff7d2b80319e76fe7a32f84beceec490a, \< 8156921a51e684a951221da7bc30a70a022f722e.

### Is there a fix for CVE-2026-39804?

Yes. Fixed in mtrudel bandit 1.11.0, mtrudel bandit 8156921a51e684a951221da7bc30a70a022f722e. Upgrade bandit to 1.11.0 or later. Upgrade bandit to 8156921a51e684a951221da7bc30a70a022f722e or later. Vendor workaround: Do not pass compress: true to WebSockAdapter.upgrade/4. Omitting this option (or setting it to false) prevents permessage-deflate from being negotiated, so the inflate path is never reached.

### How do I check if I'm affected by CVE-2026-39804?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/mtrudel/bandit/security/advisories/GHSA-frh3-6pv6-rc8j>
- patch: <https://github.com/mtrudel/bandit/commit/da4027cff7d2b80319e76fe7a32f84beceec490a>
- patch: <https://github.com/mtrudel/bandit/commit/8156921a51e684a951221da7bc30a70a022f722e>
- other: <https://cna.erlef.org/cves/CVE-2026-39804.html>
- other: <https://osv.dev/vulnerability/EEF-CVE-2026-39804>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-39804>

HTML: <https://flawdb.com/CVE-2026-39804> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-39804>
