{"id":"CVE-2026-39804","state":"PUBLISHED","title":"WebSocket permessage-deflate inflate has no output-size cap in bandit","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.\n\n'Elixir.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.\n\nAn 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.\n\nThis 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.\n\nThis issue affects bandit: from 0.5.9 before 1.11.0.","publishedAt":"2026-05-01T20:34:24.604Z","updatedAt":"2026-05-27T15:41:26.362Z","severity":{"score":8.2,"label":"High","version":"4.0","vector":"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","source":"EEF"},"assigner":"EEF","products":["mtrudel bandit"],"affected":[{"vendor":"mtrudel","product":"bandit","packageName":"bandit","packageURL":"pkg:hex/bandit","defaultStatus":"unaffected","versions":[{"version":"0.5.9","status":"affected","lessThan":"1.11.0","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*"],"modules":["'Elixir.Bandit.WebSocket.PerMessageDeflate'"],"programFiles":["lib/bandit/websocket/permessage_deflate.ex"],"programRoutines":[{"name":"'Elixir.Bandit.WebSocket.PerMessageDeflate':inflate/2"}],"repo":"https://github.com/mtrudel/bandit"},{"vendor":"mtrudel","product":"bandit","packageName":"mtrudel/bandit","packageURL":"pkg:github/mtrudel/bandit","defaultStatus":"unaffected","versions":[{"version":"da4027cff7d2b80319e76fe7a32f84beceec490a","status":"affected","lessThan":"8156921a51e684a951221da7bc30a70a022f722e","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*"],"modules":["'Elixir.Bandit.WebSocket.PerMessageDeflate'"],"programFiles":["lib/bandit/websocket/permessage_deflate.ex"],"programRoutines":[{"name":"'Elixir.Bandit.WebSocket.PerMessageDeflate':inflate/2"}],"repo":"https://github.com/mtrudel/bandit"}],"references":["https://github.com/mtrudel/bandit/security/advisories/GHSA-frh3-6pv6-rc8j","https://cna.erlef.org/cves/CVE-2026-39804.html","https://osv.dev/vulnerability/EEF-CVE-2026-39804","https://github.com/mtrudel/bandit/commit/8156921a51e684a951221da7bc30a70a022f722e"],"weaknesses":["CWE-770"],"ingestedAt":"2026-10-29T20:11:50.837Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/39xxx/CVE-2026-39804.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-39804","state":"PUBLISHED","datePublished":"2026-05-01T20:34:24.604Z","dateUpdated":"2026-05-27T15:41:26.362Z","assignerShortName":"EEF","assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateReserved":"2026-04-07T12:28:54.916Z"},"containers":{"cna":{"title":"WebSocket permessage-deflate inflate has no output-size cap in bandit","descriptions":[{"lang":"en","value":"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.\n\n'Elixir.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.\n\nAn 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.\n\nThis 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.\n\nThis issue affects bandit: from 0.5.9 before 1.11.0."}],"affected":[{"vendor":"mtrudel","product":"bandit","packageName":"bandit","packageURL":"pkg:hex/bandit","defaultStatus":"unaffected","versions":[{"version":"0.5.9","status":"affected","lessThan":"1.11.0","versionType":"semver"}],"collectionURL":"https://repo.hex.pm","cpes":["cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*"],"modules":["'Elixir.Bandit.WebSocket.PerMessageDeflate'"],"programFiles":["lib/bandit/websocket/permessage_deflate.ex"],"programRoutines":[{"name":"'Elixir.Bandit.WebSocket.PerMessageDeflate':inflate/2"}],"repo":"https://github.com/mtrudel/bandit"},{"vendor":"mtrudel","product":"bandit","packageName":"mtrudel/bandit","packageURL":"pkg:github/mtrudel/bandit","defaultStatus":"unaffected","versions":[{"version":"da4027cff7d2b80319e76fe7a32f84beceec490a","status":"affected","lessThan":"8156921a51e684a951221da7bc30a70a022f722e","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*"],"modules":["'Elixir.Bandit.WebSocket.PerMessageDeflate'"],"programFiles":["lib/bandit/websocket/permessage_deflate.ex"],"programRoutines":[{"name":"'Elixir.Bandit.WebSocket.PerMessageDeflate':inflate/2"}],"repo":"https://github.com/mtrudel/bandit"}],"references":[{"url":"https://github.com/mtrudel/bandit/security/advisories/GHSA-frh3-6pv6-rc8j","tags":["vendor-advisory","related"]},{"url":"https://cna.erlef.org/cves/CVE-2026-39804.html","tags":["related"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-39804","tags":["related"]},{"url":"https://github.com/mtrudel/bandit/commit/8156921a51e684a951221da7bc30a70a022f722e","tags":["patch"]}],"metrics":[{"cvssV4_0":{"attackComplexity":"LOW","attackRequirements":"PRESENT","attackVector":"NETWORK","baseScore":8.2,"baseSeverity":"HIGH","privilegesRequired":"NONE","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","vectorString":"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","version":"4.0","vulnAvailabilityImpact":"HIGH","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-770","description":"CWE-770 Allocation of Resources Without Limits or Throttling","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"EEF","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateUpdated":"2026-05-27T15:41:26.362Z"},"configurations":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"The vulnerability is only reachable when both of the following conditions are true:<ul><li>Bandit's server-level <tt>websocket_options.compress</tt> is enabled (it defaults to <tt>true</tt>).</li><li>The per-upgrade <tt>compress: true</tt> option is passed to <tt>WebSockAdapter.upgrade/4</tt> (it defaults to <tt>false</tt>; Phoenix's default is also <tt>false</tt>).</li></ul>Stock Phoenix and LiveView applications are not affected because <tt>compress: false</tt> is their default."}],"value":"The vulnerability is only reachable when both of the following conditions are true:\n- Bandit's server-level websocket_options.compress is enabled (it defaults to true).\n- The per-upgrade compress: true option is passed to WebSockAdapter.upgrade/4 (it defaults to false; Phoenix's default is also false).\n\nStock Phoenix and LiveView applications are not affected because compress: false is their default."}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:mtrudel:bandit:*:*:*:*:*:*:*:*","versionEndExcluding":"1.11.0","versionStartIncluding":"0.5.9","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"finder","value":"Peter Ullrich"},{"lang":"en","type":"remediation developer","value":"Mat Trudel"},{"lang":"en","type":"analyst","value":"Jonatan Männchen / EEF"}],"impacts":[{"capecId":"CAPEC-130","descriptions":[{"lang":"en","value":"CAPEC-130 Excessive Allocation"}]}],"source":{"discovery":"EXTERNAL"},"workarounds":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"Do not pass <tt>compress: true</tt> to <tt>WebSockAdapter.upgrade/4</tt>. Omitting this option (or setting it to <tt>false</tt>) prevents permessage-deflate from being negotiated, so the inflate path is never reached."}],"value":"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."}],"x_generator":{"engine":"cvelib 1.8.0"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/mtrudel/bandit/security/advisories/GHSA-frh3-6pv6-rc8j","tags":["exploit"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-05-02T01:19:00.687361Z","id":"CVE-2026-39804","options":[{"Exploitation":"poc"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-05-02T01:19:55.677Z"}}]}}}