/

CVE-2026-31842

Severity:

HIGH RISK

(7.5)

HTTP Request Smuggling / Desynchronization in Tinyproxy

CVE-2026-31842

Modified

Vulnerability type

Category:

HTTP Request Smuggling / Desynchronization

CWE:

CWE-444

Impact:

Denial of Service and Security Control Bypass

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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-Encoding header value (e.g., Transfer-Encoding: Chunked) combined with a request body.
  • Why exploitation is possible: Tinyproxy's is_chunked_transfer() uses strcmp() 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, set content_length.client to -1, skip pull_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-Encoding and Content-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-Encoding headers and correlate them with unusual backend resource consumption or timeouts.
  • Use synthetic tests that send varied-case Transfer-Encoding headers 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.

Sources

SourceLink
datatracker.ietf.orgdatatracker.ietf.org/doc/html/rfc7230
github.comgithub.com/tinyproxy/tinyproxy
github.comgithub.com/tinyproxy/tinyproxy/issues/604

Frequently asked

questions

Yes. Any remote client that can send HTTP requests through a vulnerable Tinyproxy instance can attempt to exploit this desynchronization. No special privileges are required beyond network reachability of the proxy.

No authentication is required at the protocol level for exploitation; a standard HTTP client is sufficient. A man-in-the-middle position is not necessary—the attacker simply needs to originate requests that pass through Tinyproxy.

Adopt a strict, spec-compliant HTTP parsing model: normalize header names and token values to a canonical case before comparison; implement case-insensitive comparisons where mandated by the RFC; and enforce unambiguous framing rules, rejecting requests that violate or abuse Transfer-Encoding and Content-Length semantics.

Design parsing layers as single sources of truth that fully interpret the HTTP message before higher-level logic runs, rely on well-tested protocol libraries where possible, include automated RFC-compliance tests in CI, and treat any divergence in behavior between intermediaries and backends as a security risk to be investigated and corrected promptly.

Find out what's already
exploitable in your codebase.