CL.TE and TE.CL Desync Techniques
What You'll Learn
You'll learn how attackers exploit disagreements between front-end and back-end servers about where one HTTP request ends and another begins.
Understanding Desync Conflicts
Remember HTTP Request Smuggling from the previous lesson? The most common exploitation techniques rely on conflicting interpretations of two headers: Content-Length (CL) and Transfer-Encoding (TE).
When a front-end server (like a load balancer) and back-end server disagree on which header to trust, attackers can "smuggle" a hidden second request inside what appears to be a single request.
CL.TE Desync
CL.TE means the front-end uses Content-Length, but the back-end uses Transfer-Encoding: chunked.
Analogy: Imagine a security gate that counts passengers by weight (front-end), while the interior checkpoint counts by scanning tickets (back-end). You could hide a person inside luggage—the gate passes the weight, but the second checkpoint processes an extra "person."
The attacker crafts a request where:
- The front-end reads X bytes based on
Content-Length - The back-end ignores
Content-Lengthand processes chunked encoding, finding leftover data - That leftover becomes the start of the next user's request
TE.CL Desync
TE.CL is the reverse: the front-end uses Transfer-Encoding: chunked, the back-end uses Content-Length.
The front-end forwards the entire chunked message, but the back-end only consumes what Content-Length specifies, leaving a "prefix" that gets prepended to the next legitimate request in the queue.
Why This Matters
These desync techniques let attackers:
- Bypass security controls
- Poison other users' requests
- Perform unauthorized actions
- Capture sensitive data from subsequent requests
Key Takeaway: CL.TE and TE.CL desync attacks exploit header-parsing disagreements between servers—attackers inject partial requests that contaminate the next victim's traffic, bypassing security boundaries.