Summary
Tinyproxy up to version 1.11.3 incorrectly handles HTTP requests that contain multiple Content-Length headers with conflicting values.
A remote attacker can exploit this parsing discrepancy to desynchronize Tinyproxy from the backend server, enabling HTTP request smuggling that may lead to cache poisoning, access control bypass, or hijacking of other users' requests.
Affected context
This vulnerability affects deployments where Tinyproxy sits in front of one or more HTTP backend servers and forwards client requests.
It becomes relevant when Tinyproxy and the backend apply different rules or interpretations for multiple Content-Length headers, and where downstream components (such as caches, authentication gateways, or application servers) trust Tinyproxy as an intermediary.
Any environment that processes client-controlled HTTP request bodies through Tinyproxy, particularly in multi-tenant or internet-exposed settings, may be at risk.
Exploit preconditions
- Attack surface: Tinyproxy's HTTP listener, typically exposed on a network-accessible port.
- Required access: Ability to send crafted HTTP requests through Tinyproxy (no prior authentication may be required depending on configuration).
- Trigger point: Submitting a request with multiple
Content-Lengthheaders with differing values so that Tinyproxy and the backend consume different portions of the message body. - Why exploitation is possible: Tinyproxy uses only the first Content-Length value to decide how many bytes to read for the request body but forwards all Content-Length headers unchanged, leading to a mismatch between the proxy's parsing state and the backend's interpretation of the same stream.
Why this happens
The root cause is inconsistent and incomplete HTTP message parsing logic in Tinyproxy when handling multiple Content-Length headers.
Instead of normalizing or rejecting ambiguous requests, Tinyproxy selects the first Content-Length value to determine the body length it consumes, yet it forwards all Content-Length headers to the backend unchanged.
This discrepancy violates robust request parsing principles described in CWE-444: Inconsistent Interpretation of HTTP Requests and creates a classic HTTP request smuggling condition where intermediary and backend components disagree about message boundaries.
Potential impact
- Attacker-controlled injection of hidden HTTP requests to backend servers.
- Web cache poisoning, causing subsequent users to receive attacker-influenced responses.
- Bypassing access control or authentication layers by smuggling privileged backend requests through a trusted proxy path.
- Hijacking or piggybacking on other users' requests that share the same connection pool.
- Disruption of logging and monitoring accuracy by confusing request boundaries and sources.
General mitigation guidance
Effective mitigation focuses on making HTTP parsing behavior strict, deterministic, and aligned across all components in the request path.
Recommended patterns include:
- Normalizing requests at the proxy layer by rejecting or dropping any HTTP message with multiple Content-Length headers or conflicting length indicators.
- Ensuring strict adherence to a single authoritative message length rule (e.g., favoring Transfer-Encoding semantics when allowed by policy, and otherwise rejecting ambiguous inputs).
- Configuring backend servers and intermediaries to apply consistent parsing strategies and to treat malformed or ambiguous headers as invalid.
- Limiting persistent connection reuse between untrusted clients and sensitive backend services to reduce the blast radius of smuggled requests.
- Applying least-privilege principles to what backend endpoints are exposed behind Tinyproxy and isolating high-value or administrative interfaces from generic proxy access.
How teams detect issues like this
Detection typically involves a combination of protocol-aware analysis and defensive coding checks:
- Static analysis or manual code review focused on HTTP parsing routines, especially where multiple Content-Length or mixed Transfer-Encoding and Content-Length headers are processed without normalization.
- Security testing (including fuzzing and protocol-level scanners) that sends malformed or conflicting header combinations to identify parsing discrepancies between Tinyproxy and backend servers.
- Web and proxy access log correlation to spot anomalous patterns, such as unexplained extra requests, mismatched methods, or responses that do not correspond cleanly to logged client requests.
- Use of automated HTTP compliance testing tools in CI/CD pipelines to validate that any proxy or gateway component rejects ambiguous or non-compliant requests by default.

