Vulnerability in bandit
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
A vulnerability tracked as CVE-2026-39804 has been found in bandit.
Risk of unauthorized operations or information disclosure.
What to do: upgrade bandit to 1.11.0 or later.
If unsure, ask your IT team or search "bandit CVE-2026-39804" on the vendor's site.
CVE-2026-39804 (bandit) — CWE-770
Patched: 1.11.0 — apply immediately
Workaround: Do not pass compress: true to WebSockAdapter.upgrade/4.
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-770) exists in bandit.
Check the vendor advisory for the affected versions of bandit.
Severity: ?. Risk of unauthorized operations or information disclosure.
Update to 1.11.0.
Workaround: Do not pass compress: true to WebSockAdapter.upgrade/4.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'bandit' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1
Identify exposureidentify
grep -r 'bandit' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
banditを grep し、稼働しているサービス・バージョンを把握する。 -
2
Apply temporary workaroundmitigate
Do not pass compress: true to WebSockAdapter.upgrade/4.パッチが適用されるまでの応急処置として、Do not pass compress: true to WebSockAdapter.upgrade/4. を実施。回避策の副作用 (機能低下) を確認した上で。
-
3
Apply patchpatch
Upgrade bandit to 1.11.0ステージング環境で 1.11.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4
Post-deployment verificationverify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| Hexbandit |
≥ 0.5.9, < 1.11.0→ 1.11.0 |
1.11.0 |
| mtrudelbandit |
≥ da4027cff7d2b80319e76fe7a32f84beceec490a, < 8156921a51e684a951221da7bc30a70a022f722e→ 8156921a51e684a951221da7bc30a70a022f722e |
8156921a51e684a951221da7bc30a70a022f722e |
Original description The description as published by the source.
Summary
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.
Workarounds
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.…
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
References
- advisory github.com
- advisory github.com
- advisory nvd.nist.gov
- package hex.pm
- package github.com
- patch github.com
- web cna.erlef.org
- web github.com
- web osv.dev
- web repo.hex.pm
- web github.com