Summary
Tinyproxy up to version 1.11.3 contains an HTTP request smuggling flaw where conflicting Content-Length and Transfer-Encoding: chunked headers are not correctly reconciled before forwarding to the backend.
Under these conditions, an attacker can desynchronize parsing between Tinyproxy and the backend server, enabling the injection of hidden HTTP requests that may lead to cache poisoning, access control bypass, or hijacked requests.
Affected context
The vulnerability appears in deployments where Tinyproxy sits between clients and backend HTTP servers, relaying requests without normalizing or enforcing consistent message framing.
It is most relevant when:
- Tinyproxy accepts connections from untrusted or semi-trusted clients (e.g., internet-facing or shared environments), and
- Backends interpret HTTP messages differently than Tinyproxy when both
Content-LengthandTransfer-Encoding: chunkedheaders are present.
In these scenarios, the proxy and backend can disagree on where a request ends, creating space for additional hidden requests to be smuggled through.
Exploit preconditions
- Attack surface: The Tinyproxy HTTP listener reachable by remote clients.
- Required access: Ability to send crafted HTTP requests through Tinyproxy, including control over request headers and body.
- Trigger point: Requests that include both
Content-LengthandTransfer-Encoding: chunkedheaders, with a body shaped to cause parsing disagreement. - Why exploitation is possible: Tinyproxy forwards both headers to the backend but uses only
Content-Lengthto decide how much of the body to consume. The backend may prioritizeTransfer-Encoding: chunked, causing the two components to disagree about message boundaries. This parser desynchronization allows a hidden "next" request to be interpreted by the backend as a separate, attacker-controlled request.
Why this happens
This issue stems from inconsistent HTTP message framing handling within the proxy and between the proxy and backend.
Tinyproxy fails to apply a clear precedence rule or to normalize conflicting Content-Length and Transfer-Encoding: chunked headers, and it forwards both verbatim.
Internally, it uses Content-Length to decide how many bytes to read, while many backends follow modern guidance and treat Transfer-Encoding as authoritative. This mismatch produces a classic CWE-444: Inconsistent Interpretation of HTTP Requests (HTTP Request Smuggling), where intermediary and backend parse the same bytes into different logical requests.
Potential impact
- Attacker-controlled hidden HTTP requests can be sent to backend servers through Tinyproxy.
- Cache poisoning, including storing malicious responses under URLs that will be served to other users.
- Access control bypass by smuggling requests that appear internal, authenticated, or whitelisted to the backend.
- Request hijacking, where victim traffic is coalesced or interleaved with attacker-controlled requests.
- Potential credential or session token exposure via manipulated responses or cache behavior.
General mitigation guidance
Effective mitigation focuses on enforcing consistent HTTP message framing and reducing trust in client-supplied headers.
General patterns include:
- Normalizing or rejecting requests that contain both
Content-LengthandTransfer-Encodingheaders, especially whenTransfer-Encoding: chunkedis present. - Implementing strict parsing logic that follows a single, standards-aligned precedence rule for determining the body length and applying it consistently to both proxy and backend integration.
- Sanitizing or removing conflicting or duplicate hop-by-hop headers before forwarding to the backend.
- Limiting exposure of Tinyproxy to untrusted clients, and segmenting sensitive backend services behind additional controls.
- Applying least-privilege and separation-of-duties patterns so that a compromised backend route has constrained access to data and internal networks.
How teams detect issues like this
Detecting this class of issue typically involves a combination of code-centric and traffic-centric approaches:
- Static analysis and code review: Look for HTTP parsing code where both
Content-LengthandTransfer-Encodingare read but not reconciled, or where they are forwarded unchanged to the backend. Signals include conditional logic that uses only one header to determine body length while preserving both. - Protocol and regression tests: Add automated tests that send malformed or ambiguous requests (e.g., dual headers, mismatched lengths) through Tinyproxy to a test backend, verifying that no extra requests are seen by the backend.
- Runtime monitoring: Inspect reverse proxy or backend logs for anomalous patterns such as unexpected extra requests, odd paths appearing only after certain clients, or cache entries populated by unusual request sequences.
- Security scanning tools: Use HTTP request smuggling scanners or proxies capable of crafting ambiguous HTTP messages to probe deployed instances and identify desynchronization behavior in a controlled environment.

