Tinyproxy - HTTP Request Smuggling via CL/TE Desynchronization
Description
Tinyproxy through 1.11.3, fixed in commit ff45d3b, fails to reconcile conflicting Content-Length and Transfer-Encoding: chunked headers, forwarding both verbatim to the backend while using Content-Length to determine how many request body bytes to consume. Remote attackers can desynchronize the proxy and backend parser state, allowing injection of arbitrary HTTP requests to the backend to enable cache poisoning, access control bypass, and request hijacking.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
1Patches
Vulnerability mechanics
Root cause
"Tinyproxy uses Content-Length to determine request body size but forwards both Content-Length and Transfer-Encoding headers to the backend, and unconditionally forwards duplicate Content-Length headers, causing a parser state desynchronization."
Attack vector
An attacker sends an HTTP request containing both `Content-Length` and `Transfer-Encoding: chunked` headers (CL/TE desync) or multiple `Content-Length` headers with different values. Tinyproxy uses the first `Content-Length` value to determine how many body bytes to consume, but forwards all headers verbatim to the backend. The backend, per RFC 7230, uses `Transfer-Encoding` when both are present (CL/TE case) or the last `Content-Length` value (duplicate CL case), causing the proxy and backend to disagree on request boundaries. This desynchronization allows the attacker to inject arbitrary HTTP requests into the backend connection, enabling cache poisoning, access control bypass, and request hijacking [CWE-444] [ref_id=1].
Affected code
The vulnerability resides in `src/reqs.c` where `process_client_headers()` uses `Content-Length` to determine body size but forwards both `Content-Length` and `Transfer-Encoding: chunked` headers to the backend. Additionally, `src/pseudomap.c`'s `pseudomap_append()` unconditionally adds duplicate headers, and the forwarding loop in `src/reqs.c:953-971` sends all duplicates to the backend.
What the fix does
Patch [patch_id=6466823] modifies `process_client_headers()` in `src/reqs.c` to check for `Transfer-Encoding: chunked` regardless of whether `Content-Length` is present. When both headers exist, it removes the `Content-Length` header from the forwarded set, preventing the CL/TE desync. Patch [patch_id=6466822] adds a duplicate `Content-Length` check in `add_header_to_connection()` in `src/reqs.c`, returning early if a `Content-Length` header already exists, thus preventing multiple `Content-Length` headers from being emitted to the backend.
Preconditions
- networkThe attacker must be able to send crafted HTTP requests to the Tinyproxy instance
- configThe backend server must interpret conflicting headers per RFC 7230 (i.e., prefer Transfer-Encoding over Content-Length, or use the last Content-Length value)
Generated on Jun 18, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
4- github.com/tinyproxy/tinyproxy/commit/ff45d3bf0e61d0f8ed97ab379d3047f04eb67521mitrepatch
- www.vulncheck.com/advisories/tinyproxy-http-request-smuggling-via-cl-te-desynchronizationmitrethird-party-advisory
- github.com/tinyproxy/tinyproxy/issues/609mitretechnical-description
- github.com/tinyproxy/tinyproxy/pull/610mitreissue-tracking
News mentions
0No linked articles in our index yet.