Summary
Tinyproxy through 1.11.3 contains an HTTP request parsing desynchronization issue where the Transfer-Encoding header is compared in a case-sensitive way, contrary to RFC 7230 requirements.
An unauthenticated remote attacker can send specially crafted requests (e.g., Transfer-Encoding: Chunked) that cause Tinyproxy and the backend server to disagree about the presence of a request body, leading to hanging connections, backend worker exhaustion, and potential bypass of body-based inspection or filtering.
Affected context
This vulnerability affects environments where Tinyproxy (through 1.11.3) is deployed as a forward or reverse HTTP proxy in front of RFC-compliant backends (such as Node.js or Nginx).
It becomes relevant when:
- Clients are allowed to send requests with Transfer-Encoding headers
- Backends correctly implement case-insensitive handling of transfer codings
- Tinyproxy is relied upon for intermediary functions such as request-body inspection, logging, filtering, or security enforcement
In these contexts, Tinyproxy may misinterpret certain requests as body-less while the backend continues to expect a chunked body.
Exploit preconditions
- Attack surface: Public or internal HTTP proxy interface exposed by Tinyproxy.
- Required access: Any network client that can send HTTP requests through Tinyproxy; no authentication is required by the vulnerability itself.
- Trigger point: Submission of HTTP requests using a case-variant
Transfer-Encodingheader value (e.g.,Transfer-Encoding: Chunked) combined with a request body. - Why exploitation is possible: Tinyproxy's
is_chunked_transfer()usesstrcmp()to compare the header value to"chunked", treating transfer-coding names as case-sensitive. RFC 7230 requires case-insensitive comparison, so Tinyproxy may conclude that no transfer encoding is present, setcontent_length.clientto -1, skippull_client_data_chunked(), and enter raw TCP relay mode with unread body data still buffered, desynchronizing state with the backend.
Why this happens
The underlying problem is a protocol parsing error that violates HTTP specification rules for case-insensitive token handling.
In src/reqs.c, Tinyproxy's logic for identifying chunked transfer encoding relies on strcmp() against the literal string "chunked", which only matches one specific capitalization.
According to RFC 7230, transfer-coding names are case-insensitive; implementations must treat "chunked", "Chunked", and "CHUNKED" equivalently.
This mismatch between specification and implementation leads to CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request Smuggling'), where Tinyproxy and the backend interpret the same byte stream differently—Tinyproxy believes there is no body while the backend correctly waits for chunked data—creating opportunities for denial of service and control bypass.
Potential impact
- Connections between Tinyproxy and backend servers can hang indefinitely while backends wait for body data that Tinyproxy never forwards.
- Backend worker pools and connection limits may be exhausted, degrading performance or causing an application-level denial of service.
- In deployments using Tinyproxy for request-body inspection (e.g., WAF-like filtering, data loss prevention, or logging), body content may be forwarded to the backend without being processed or inspected as intended.
- Downstream security controls relying on accurate request parsing by Tinyproxy can be bypassed, potentially allowing malicious payloads to reach backend services unfiltered.
- Operational instability may occur, including increased resource consumption and timeouts in upstream components.
General mitigation guidance
Effective mitigation focuses on enforcing consistent, specification-compliant HTTP parsing and reducing exposure of fragile parsing logic:
- Ensure header and token comparisons involving HTTP transfer encodings and similar protocol elements are performed in a case-insensitive manner, aligning with RFC 7230.
- Centralize HTTP parsing logic so that case normalization and canonicalization of header names and values occur before decision-making code is executed.
- Introduce strict request validation that rejects malformed or ambiguous combinations of
Transfer-EncodingandContent-Length, rather than attempting to proceed on ambiguous input. - Limit the proxy's trust boundary by applying least-privilege responsibilities: avoid overloading Tinyproxy with security-critical inspection duties without robust parsing guarantees.
- Apply connection and request rate limiting to prevent a small number of clients from tying up large numbers of backend workers.
- Use conservative timeouts on backend connections and request processing so that stalled or hung requests are terminated rather than allowed to accumulate.
How teams detect issues like this
Detection can combine code-centric and behavior-centric approaches:
- Static analysis & code review:
- Search for direct string comparisons on HTTP header values (e.g.,
strcmp("chunked")) and verify they implement case-insensitive semantics. - Flag parsing logic that does not normalize header names and token values before comparison.
- Review proxy modules that handle
Transfer-Encoding,Content-Length, and body framing for inconsistency with RFC 7230. - Dynamic and operational monitoring:
- Monitor backend servers for long-lived, idle, or half-open connections originating from Tinyproxy that exceed typical request handling times.
- Track patterns of requests with
Transfer-Encodingheaders and correlate them with unusual backend resource consumption or timeouts. - Use synthetic tests that send varied-case
Transfer-Encodingheaders through the proxy and verify consistent behavior and proper body handling. - Policy and tooling:
- Integrate automated HTTP protocol compliance tests into CI/CD pipelines for proxy components and intermediaries.
- Employ security scanners or fuzzers tailored to HTTP request smuggling and desynchronization to probe for inconsistent parsing between proxies and backends.

