{"id":"CVE-2026-84380","aliases":["CVE-2026-84380","GHSA-pf96-p4fj-6566","PYSEC-2026-3849"],"related":[],"kind":"vulnerability","state":"published","title":"HTTPX2: Conflicting Content-Length and Transfer-Encoding headers can be auto-generated","summary":"HTTPX2 is a next generation HTTP client for Python. Prior to 2.11.0, Request._prepare() in src/httpx2/httpx2/_models.py can add a body-derived Content-Length header to a request that already contains a caller-supplied Transfer-Encoding header because its setdefault() processing checks each default header independently rather than treating the two framing headers as mutually exclusive. Fixed-size byte, JSON, form, and known-length multipart bodies can therefore be serialized over HTTP/1.1 with both headers, allowing request smuggling or connection desynchronization when downstream intermediaries disagree about which framing header takes precedence. This issue is fixed in version 2.11.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"HTTPX2 is a next generation HTTP client for Python. Prior to 2.11.0, Request._prepare() in src/httpx2/httpx2/_models.py can add a body-derived Content-Length header to a request that already contains a caller-supplied Transfer-Encoding header because its setdefault() processing checks each default header independently rather than treating the two framing headers as mutually exclusive. Fixed-size byte, JSON, form, and known-length multipart bodies can therefore be serialized over HTTP/1.1 with both headers, allowing request smuggling or connection desynchronization when downstream intermediaries disagree about which framing header takes precedence. This issue is fixed in version 2.11.0.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nHTTPX2 can automatically add a `Content-Length` header to a request that already contains a caller-supplied `Transfer-Encoding` header. The resulting HTTP/1.1 request contains both framing headers, which can create an ambiguous message boundary and enable request smuggling or connection desynchronization when processed by intermediaries that disagree about which header takes precedence.\n\n### Details\n\nWhen a request body has a known size, HTTPX2's content encoder returns a default `Content-Length`. `Request._prepare()` applies each default header with `setdefault()`, which only checks whether that same header is already present. It does not check whether the mutually exclusive `Transfer-Encoding` header is present.\n\nFor example:\n\n```python\nimport httpx2\n\nrequest = httpx2.Request(\n    \"POST\",\n    \"http://example.com/\",\n    headers={\"Transfer-Encoding\": \"chunked\"},\n    content=b\"test 123\",\n)\n\nprint(request.headers)\n```\n\nThe request contains both:\n\n```text\nTransfer-Encoding: chunked\nContent-Length: 8\n```\n\nOn an HTTP/1.1 connection, the body is serialized using chunked transfer coding while both headers are sent on the wire. This violates HTTP message-framing requirements. Fixed-size byte, JSON, form, and known-length multipart bodies can reach the affected path.\n\nStreaming bodies with an explicit `Content-Length` are not affected in current HTTPX2 releases because the automatically generated `Transfer-Encoding` is already suppressed in that direction.\n\n### Impact\n\nAn attacker may be able to use the conflicting framing headers as a request-smuggling or desynchronization primitive. Exploitation requires an application to pass attacker-controlled request framing headers and associated body data to HTTPX2, use HTTP/1.1, and communicate through a proxy or origin that accepts conflicting headers and interprets them differently from another hop.\n\nDepending on the downstream infrastructure, successful exploitation could interfere with requests sharing a persistent connection, bypass front-end routing or authorization decisions, or poison responses or caches. Applications that do not forward attacker-controlled `Transfer-Encoding` headers are not directly exposed.\n\n### Mitigation\n\nUpgrade to HTTPX2 `2.11.0` or later. Patched versions treat `Content-Length` and `Transfer-Encoding` as mutually exclusive when applying automatically generated request headers.\n\nIf upgrading is not immediately possible, remove `Transfer-Encoding` and other hop-by-hop framing headers from untrusted input before constructing outbound requests. Applications acting as proxies should derive outbound framing from the body rather than forwarding inbound `Content-Length` or `Transfer-Encoding` headers.","format":"markdown","source":"ghsa"}],"published":"2026-09-02T17:58:55.520Z","modified":"2026-09-10T12:25:28.219Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L","score":5.6,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L","score":5.6,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L","score":5.6,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L","score":5.6,"rating":"MEDIUM"}],"cwes":["CWE-444"],"affected":[{"ranges":[{"version":"< 2.11.0","status":"affected"}],"vendor":"pydantic","product":"httpx2","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.11.0"}],"ecosystem":"PyPI","package":"httpx2","purl":"pkg:pypi/httpx2","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.11.0"}],"ecosystem":"PyPI","package":"httpx2","purl":"pkg:pypi/httpx2","source":"pysec"}],"references":[{"url":"https://github.com/pydantic/httpx2/security/advisories/GHSA-pf96-p4fj-6566","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydantic/httpx2/pull/1137","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydantic/httpx2/commit/829b93a2393212996f613e635261f777d9ec6eab","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pydantic/httpx2/releases/tag/v2.11.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-84380","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pydantic/httpx2","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/httpx2","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-pf96-p4fj-6566","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-09-02T18:07:09.850Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-84380","url":"https://www.cve.org/CVERecord?id=CVE-2026-84380","licence":"CVE Terms of Use","modified":"2026-09-02T18:07:36.980Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pf96-p4fj-6566","url":"https://github.com/advisories/GHSA-pf96-p4fj-6566","licence":"CC-BY-4.0","modified":"2026-09-10T12:25:28.219Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-84380","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-84380","licence":"Public domain","modified":"2026-09-09T21:05:23.237Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3849","url":"https://osv.dev/vulnerability/PYSEC-2026-3849","licence":"CC-BY-4.0","modified":"2026-09-10T12:15:06.096Z"}],"updatedAt":"2026-11-25T22:59:36.140Z","epss":{"score":0.00275,"percentile":0.21259,"date":"2026-12-01T12:00:22.000Z"}}