HTTP Request Smuggling via Content-Length and Transfer-Encoding Desync (CL-TE) - I am not a…
The nginx front-end and Go back-end disagreed on how to frame HTTP requests when both Content-Length and Transfer-Encoding headers were present, letting an attacker smuggle a second request past the proxy. This was used to perform forced browsing to a higher-privileged endpoint using a low-privilege user's identifier.
Published on shahjerry33.medium.com
Infosec
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This is a write-up of a CL.TE HTTP request smuggling vulnerability found in an application whose infrastructure ran nginx as a reverse proxy in front of a Go back-end API server. The two components disagree about where a single HTTP request ends when a request carries both Content-Length and Transfer-Encoding: chunked. Nginx prioritises Content-Length; the Go back-end prioritises Transfer-Encoding: chunked. The result is a de-synchronisation that lets an attacker place a second request inside the body of the first, which the back-end then processes as a separate, legitimate request.
Request smuggling is primarily associated with HTTP/1 requests, though sites that support HTTP/2 can be vulnerable depending on their back-end architecture. The general impact class is well known: bypassing security controls, unauthorised access to sensitive data, and compromise of other application users.

Setup
The report does not describe the target application, the accounts used, or the tooling beyond the options visible in the screenshots. What it does show is that the testing was done with a proxy tool that exposes toggles for Update Content-Length, Enable HTTP/1 Connection Reuse, Enable HTTP/2 Connection Reuse and Allow HTTP/2 ALPN override. The researcher also refers to an AUTH_ID value belonging to a low-privileged user, and to an endpoint that is available to a high-privileged user, so at least two privilege levels existed in the application.
Finding it
The architecture is the precondition. Nginx and the Go HTTP server parse the same byte stream, but they disagree about where one HTTP request ends.

Normal Architecture
The ambiguity comes from a request that contains both framing headers:

Headers Ambiguity
These headers describe two different ways of determining the request body length:
Content-Lengthsays the body is exactly N bytes long.Transfer-Encoding: chunkedsays the body consists of chunks and ends when the zero-length chunk is encountered.
A correctly implemented HTTP stack should reject or otherwise safely handle this ambiguity rather than allowing two different interpretations.

CL.TE Condition
That combination is the CL.TE condition.
Exploitation
Step 1: Confirm smuggling with a 404 request
The researcher sent a smuggled request for a 404 page on the login request and got two responses, which confirmed request smuggling.

Normal Check - 404 Page
Two responses to what should be one request is the classic signal that the front-end and back-end framed the byte stream differently: the back-end treated leftover bytes as a second request and answered it.
Step 2: Smuggle a valid endpoint
Next, the researcher unchecked Update Content-Length, Enable HTTP/1 Connection Reuse, Enable HTTP/2 Connection Reuse and Allow HTTP/2 ALPN override, then sent a smuggled request with a valid endpoint.

Smuggled Valid Request
Step 3: Forced browsing with a low-privileged AUTH_ID
The researcher then sent a smuggled forced browsing request using an AUTH_ID of a low-level user to access an endpoint available to a high-privileged user.

This is where the smuggling becomes an access control bypass: the smuggled request carries the low-privileged identity but reaches functionality reserved for a higher privilege level.
Step 4: The developer's fix
A developer deployed a fix for the smuggling attack, but only for the normal header Transfer-Encoding: chunked.

Improper Fix - Transfer-Encoding: chunked
Step 5: Bypass the fix with a space in the header name
The researcher crafted a similar smuggling request but with a space in the header, Transfer-Encoding : chunked.

Bypassed - Transfer-Encoding : chunked
Root cause
The root cause is not simply that nginx supports Content-Length or that Go supports chunked encoding. It is the combination of:
- Ambiguous framing information (
Content-LengthplusTransfer-Encoding) - Different parsing priorities between the front-end and the back-end
- A persistent connection, allowing leftover bytes to become meaningful
- Failure to reject the ambiguous request consistently

Root Cause
In the researcher's analysis, nginx forwards both Content-Length and Transfer-Encoding headers to the Go back-end without normalisation. Nginx determines the body length using Content-Length (6 bytes in the researcher's example), but the Go back-end follows RFC 7230 and uses the chunked encoding. The extra bytes after the chunk terminator become a smuggled request. Nginx's default proxy_pass configuration does not strip conflicting headers or buffer the request body, and combined with HTTP/1.1 keepalive on the back-end connection, leftover bytes persist and get interpreted as new requests.
Concretely, nginx reads the number of bytes given by Content-Length and forwards them, while the back-end reads until the chunked terminator (0\r\n\r\n) and then interprets the remaining data as the start of a new HTTP request.

Crafted Request
The two components see different request boundaries. Nginx effectively says the body is N bytes because Content-Length says so, consumes that many bytes and forwards the resulting stream toward the Go server. The Go parser instead says this is chunked encoding, keeps reading chunks until 0\r\n\r\n, and once it encounters the terminating zero-length chunk considers the first request complete. If additional bytes remain in the connection, Go can interpret them as the beginning of another HTTP request.

Classic De-sync
The proxy believes one thing about the stream:

while the back-end sees another:

Data that the front-end believes is part of the first request becomes a new HTTP request from the back-end's perspective. The attacker is not necessarily bypassing the proxy by directly reaching the back-end; they are manipulating the parser state of the persistent connection.
The dangerous part is the security boundary. Nginx may apply security controls to what it believes is request #1:

Security Boundary
But the Go server may subsequently interpret the leftover bytes as request #2. Request #2 can therefore reach an endpoint or carry semantics the attacker could not achieve through a normally parsed request. The impact depends heavily on the application's architecture and on what endpoints, authentication mechanisms, connection reuse and intermediary behaviour are present.

Request Smuggling

Attack Flow
Impact
The researcher's stated impact: an attacker can exploit the parsing differences between the nginx reverse proxy and the Go back-end to inject and execute unauthorised HTTP requests, bypassing security controls, accessing unauthorised functionality, poisoning caches, hijacking user requests, or compromising the integrity and confidentiality of back-end communications. During testing it was confirmed that the vulnerability could be leveraged to perform a forced browsing attack via a smuggled request, allowing access to sensitive resources and the viewing of sensitive data.
The report gives a CVSS 3.1 vector and score:
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
Score: 9.6 Critical. The researcher's explanation of each metric:
| Metric | Value | Reasoning given |
|---|---|---|
| Attack Vector | Network | The attacker can access the project over the network, as it is a web application |
| Attack Complexity | Low | The attacker does not need to craft any special exploits |
| Privileges Required | Low | The attacker needs to be a guest user at least to read data |
| User Interaction | None | No additional user interaction is needed |
| Scope | Changed | The vulnerable component is nginx (front-end proxy) and the impacted component is the Go back-end (API server), maintained by different security authorities |
| Confidentiality | High | The attacker is able to perform forced browsing via a smuggled request |
| Integrity | High | The attack can lead to WAF bypass, response poisoning, smuggled writes possible |
| Availability | None | The overall website remains accessible |
Fix
The researcher recommends the following mitigations:
- Reject ambiguous requests. Configure nginx to reject requests containing both
Content-LengthandTransfer-Encodingheaders:
if ($http_transfer_encoding ~* “chunked” ) {
# reject if Content-Length is also present
}
- Enable proxy request buffering.
proxy_request_buffering onforces nginx to fully read the request before proxying, eliminating desync. - Upgrade back-end communication to HTTP/2.
proxy_http_version 2between nginx and the Go back-end eliminates CL/TE ambiguity. - Disable HTTP/1.1 entirely. If all clients support HTTP/2, disable the HTTP/1.1 listener on nginx.
- Normalise
Transfer-Encoding. Strip or reject non-standardTransfer-Encodingvalues before proxying.
Variants to test
Thanks to Domagoj Klemen-Marković for proofreading.

What happened, in plain words
A website had two pieces of software standing between you and its data. The first, nginx, is a reverse proxy: a doorman that receives every request from the internet, checks it, and passes it on. The second, a Go program, is the back-end: the actual application that holds the data and decides who may see what.
Normally the doorman and the application agree on where one message ends and the next begins. In this application they did not. When a request carried two different instructions about how long its body was, nginx believed one instruction and the Go server believed the other. The result was that a second, hidden request could be tucked inside the body of the first. Nginx checked the request it thought it was forwarding; the Go server could then read the leftover bytes as a brand new request.
That is HTTP request smuggling. The researcher sent a smuggled forced browsing request using an AUTH_ID of a low-level user to reach an endpoint available to a high-privileged user. When the developer shipped a fix, the researcher got around it by adding a single space to a header name.

The background you need first
Before the details, four ideas, because everything below depends on them.
HTTP is the language a browser and a website speak. You type an address, the browser sends a short text message (a request) asking for a page, and the server sends back a response. A request looks roughly like this: a first line saying what you want, then a stack of Name: value lines called headers, then optionally a body with data in it.
A reverse proxy is a server that sits in front of the real application. Visitors talk to the proxy; the proxy talks to the application. Companies do this for caching, for load balancing, and for security filtering. Think of a receptionist who takes every visitor's details before letting them through to the office. nginx is one of the most common reverse proxies in the world.
An API (application programming interface) is the set of addresses and rules a program exposes so other programs can ask it for things. A back-end API server is the program that actually does the work: it looks up your account, returns your data, and so on. Here it was written in Go, a programming language made by Google, and its built-in web server is what parsed the incoming requests.
A cookie or token is a small piece of text your browser sends with every request so the server knows who you are. When you log in, the server hands you something like a session identifier, and you show it on every later request instead of typing your password again. In this application the identity was carried in a value called AUTH_ID. If you have a low-privileged account, your AUTH_ID says so, and the server is supposed to refuse you the pages meant for administrators.
One more idea, the heart of the whole bug: how does a server know where a request's body ends? Two headers answer that question.
Content-Length: 6means "the body is exactly 6 bytes long, count them and stop".Transfer-Encoding: chunkedmeans "the body arrives in pieces (chunks), and I will signal the end with a special zero-length chunk".
A well-behaved server should never accept a request that contains both, because the two instructions can contradict each other. When a front-end and a back-end resolve that contradiction differently, you have a desynchronisation, and desynchronisation is what smuggling is built on.
Request smuggling is mostly an HTTP/1 problem. Sites that speak HTTP/2 can still be vulnerable depending on how their back-end is built, but the classic cases live in HTTP/1.
The setup
The report does not name the application, the accounts, or the exact tool beyond the options visible in its screenshots. What it does show is that testing was done with a proxy tool, a program that sits between your browser and the site so you can read and edit every request by hand. That tool had four switches:
- Update Content-Length: automatically recalculate the
Content-Lengthheader to match the body you typed. - Enable HTTP/1 Connection Reuse: keep the same network connection open for several requests in a row.
- Enable HTTP/2 Connection Reuse: the same idea for HTTP/2.
- Allow HTTP/2 ALPN override: let the tool force which version of HTTP gets negotiated with the server.
Those switches matter later. The report also refers to an AUTH_ID belonging to a low-privileged user and to an endpoint available to a high-privileged user, so the application had at least two levels of access.
How the architecture creates the problem
The precondition is the arrangement itself: nginx in front, Go behind. Both read the very same stream of bytes coming off the network, but they disagree about where one HTTP request stops.

Normal Architecture
The ambiguity appears when a single request carries both framing headers at once:

Headers Ambiguity
Those two headers describe two different ways of measuring the body:
Content-Lengthsays the body is exactly N bytes long.Transfer-Encoding: chunkedsays the body is made of chunks and ends when the zero-length chunk appears.
A correctly built HTTP stack should reject such a request, or handle it in some other safe way, rather than allowing two readings of the same bytes.

CL.TE Condition
That combination is called the CL.TE condition: the front-end trusts Content-Length, the back-end trusts Transfer-Encoding. The name is just the two initials in the order of who believes what.
Where the two sides drift apart
The attacker sends a crafted request.

Crafted Request
Now the two components see different boundaries for the same request.
What nginx thinks. "The body is N bytes, because Content-Length says so." It counts off that many bytes, passes them along to the Go server, and considers the request finished.
What Go thinks. "This is chunked encoding, so I keep reading chunks until I hit 0\r\n\r\n." When it reaches that zero-length chunk, it considers the first request complete. If there are still bytes left on the connection, Go treats them as the start of another HTTP request.
That is the critical desynchronisation.

Classic De-sync
Why the second request counts as smuggled
The attacker has made the proxy and the back-end disagree about the structure of one and the same stream of bytes on a TCP connection. (TCP is the underlying network conversation; a persistent or keep-alive connection is one kept open so several requests can travel over it one after another.)
The proxy believes one thing:

while the back-end sees another:

So data the front-end regards as part of request number one becomes, from the back-end's point of view, a brand new HTTP request. That is why the technique is called HTTP Request Smuggling: the second request is hidden inside the first, like a letter inside another letter's envelope.
The attacker is not necessarily reaching the back-end directly and skipping the proxy. They are fiddling with the parser state of the open connection: the internal bookkeeping each server keeps about how far through a message it is.
The security boundary that gets crossed
The really dangerous part is what nginx does with the request it thinks it is handling. It may apply its security checks to what it believes is request #1.

Security Boundary
But the Go server may then read the leftover bytes as request #2. That second request can reach an endpoint, or carry a meaning, that the attacker could never have achieved with a normally formed request, because nginx never inspected it.
How bad this gets depends heavily on the application: which endpoints exist, how authentication works, whether connections are reused, and how the intermediaries in between behave.

Request Smuggling
The root cause
The root cause is not simply "nginx supports Content-Length" or "Go supports chunked encoding". It is the combination of four things:
- Ambiguous framing information: both
Content-LengthandTransfer-Encodingpresent. - Different parsing priorities between the front-end and the back-end.
- A persistent connection, so leftover bytes stay around and mean something.
- A failure to reject the ambiguous request consistently.

Root Cause
In the researcher's analysis, nginx forwards both headers to the Go back-end without normalising them. Nginx measures the body with Content-Length (6 bytes in the researcher's example), while the Go back-end follows the HTTP specification, RFC 7230, and uses the chunked encoding. The extra bytes after the chunk terminator become the smuggled request. Nginx's default proxy_pass setup does not strip conflicting headers and does not buffer the request body, and with HTTP/1.1 keepalive on the back-end connection the leftover bytes persist and get read as new requests.
In plain terms: nginx reads the number of bytes Content-Length gives and forwards them; the back-end reads until 0\r\n\r\n and then treats whatever remains as the start of a new request.
How the researcher found it
Step 1: confirm smuggling with a 404 request
The researcher sent a smuggled request for a 404 page on the login request and got two responses, which confirmed request smuggling.

Normal Check - 404 Page
Why this works as a test: one request should produce one response. Getting two means the back-end answered the first request and then answered the leftover bytes as a second one. That is the classic signal that the front-end and back-end framed the stream differently.
Step 2: smuggle a request to a valid endpoint
Next, the researcher unchecked Update Content-Length, Enable HTTP/1 Connection Reuse, Enable HTTP/2 Connection Reuse and Allow HTTP/2 ALPN override, then sent a smuggled request with a valid endpoint.

Smuggled Valid Request
Why each switch had to go:
- (ALPN is the part of the connection handshake where client and server agree which HTTP version to use.)
Step 3: forced browsing with a low-privileged AUTH_ID
The researcher then sent a smuggled forced browsing request using an AUTH_ID of a low-level user to access an endpoint available to a high-privileged user.

Forced browsing means asking for pages or addresses you are not supposed to be allowed to see, hoping the server will hand them over anyway. Here the smuggled request carried the low-privileged identity, yet reached functionality reserved for a higher privilege level. That is where smuggling turns into an access-control bypass: the proxy checked the request it thought it was forwarding, and the hidden second request slipped past that check.
Step 4: the developer's fix
A developer deployed a fix for the smuggling attack, but only for the normal header Transfer-Encoding: chunked.

Improper Fix - Transfer-Encoding: chunked
A fix that only recognises one exact spelling of a header is fragile, because HTTP header names can be written in more than one way and parsers are not always strict about it.
Step 5: bypass the fix with a space in the header name
The researcher crafted a similar smuggling request but with a space in the header, Transfer-Encoding : chunked.

Bypassed - Transfer-Encoding : chunked
What the impact was
In the researcher's words, the parsing differences between the nginx reverse proxy and the Go back-end let an attacker inject and execute unauthorised HTTP requests. That means bypassing security controls, reaching unauthorised functionality, poisoning caches (making the site serve wrong content to other users), hijacking other users' requests, and damaging the integrity and confidentiality of back-end communications.
During testing it was confirmed that the vulnerability could be used for a forced browsing attack via a smuggled request, giving access to sensitive resources and letting the researcher view sensitive data.
The report also gives a CVSS 3.1 vector and score. CVSS is a standard scoring system for vulnerabilities: it turns a set of answers about a bug into a number from 0 to 10, so teams can compare severity.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
Score: 9.6 Critical. Each part of that string, and the researcher's reasoning:
| Metric | Value | Reasoning given |
|---|---|---|
| Attack Vector | Network | The attacker can access the project over the network, as it is a web application |
| Attack Complexity | Low | The attacker does not need to craft any special exploits |
| Privileges Required | Low | The attacker needs to be a guest user at least to read data |
| User Interaction | None | No additional user interaction is needed |
| Scope | Changed | The vulnerable component is nginx (front-end proxy) and the impacted component is the Go back-end (API server), maintained by different security authorities |
| Confidentiality | High | The attacker is able to perform forced browsing via a smuggled request |
| Integrity | High | The attack can lead to WAF bypass, response poisoning, smuggled writes possible |
| Availability | None | The overall website remains accessible |
A quick reading of the table: the attacker works over the internet (Network), needs no clever exploit (Low complexity), needs only a basic account (Low privileges), needs no help from a victim (No interaction), and crosses from one system into another (Scope Changed). Data secrecy and data trustworthiness are both badly affected (High, High), while the site stays up (Availability None). A WAF is a web application firewall, a filter that inspects traffic for attacks; bypassing it means the smuggled request gets past that filter.

Attack Flow
How to fix it
The researcher recommends these mitigations:
- Reject ambiguous requests. Configure nginx to reject requests that contain both
Content-LengthandTransfer-Encodingheaders:
if ($http_transfer_encoding ~* “chunked” ) {
# reject if Content-Length is also present
}
Line by line: if ( starts a conditional check in nginx's configuration language. $http_transfer_encoding is the variable holding the value of the incoming Transfer-Encoding header. ~* means "match this pattern, ignoring upper and lower case". “chunked” is the pattern being looked for. The braces hold what should happen when the condition is true, and the line starting with # is a comment explaining the intent: reject the request if a Content-Length header is also present. The comment is the important part; the snippet is a sketch of the check, not a complete rule.
- Enable proxy request buffering.
proxy_request_buffering onforces nginx to read the whole request before passing it on, which removes the desync. - Upgrade back-end communication to HTTP/2.
proxy_http_version 2between nginx and the Go back-end removes the CL/TE ambiguity. - Disable HTTP/1.1 entirely. If every client supports HTTP/2, turn off the HTTP/1.1 listener on nginx.
- Normalise
Transfer-Encoding. Strip or reject non-standardTransfer-Encodingvalues before proxying.
Other things worth testing
Thanks to Domagoj Klemen-Marković for proofreading.

Glossary
- HTTP: the language browsers and web servers use to exchange requests and responses.
- Request: the message your browser sends to ask a server for something.
- Response: the message the server sends back.
- Header: a
Name: valueline in a request or response carrying extra information, such as how long the body is. - Body: the optional data part of a request or response.
- Reverse proxy: a server that sits in front of the real application, receiving visitors' traffic and passing it on.
- nginx: a widely used web server and reverse proxy.
- Back-end: the application server behind the proxy that actually holds the data and does the work.
- Go: a programming language, and here also the name of the web server built into it that parsed requests.
- API: the set of addresses and rules a program exposes so other programs can ask it for things.
- Endpoint: one specific address or function in an API, such as a login page or a user list.
- Cookie / token: a small piece of text your browser sends with each request so the server knows who you are.
AUTH_ID: the value this application used to identify the logged-in user.Content-Length: a header stating the exact size of the body in bytes.Transfer-Encoding: chunked: a header stating the body arrives in chunks and ends with a zero-length chunk.- Chunk: one piece of a chunked body.
- Chunk terminator: the zero-length chunk,
0\r\n\r\n, that marks the end of a chunked body. - Framing: how a server decides where one message ends and the next begins.
- Ambiguous request: a request that can be read in more than one way, for example because it carries both framing headers.
- Desynchronisation / desync: a state where two servers disagree about the structure of the same stream of bytes.
- HTTP request smuggling: hiding a second request inside the first so the back-end processes it without the front-end inspecting it.
- CL.TE: a smuggling case where the front-end trusts
Content-Lengthand the back-end trustsTransfer-Encoding. - TE.CL: the reverse case, where the front-end trusts
Transfer-Encodingand the back-end trustsContent-Length. - TCP: the underlying network conversation that carries HTTP messages.
- Persistent / keep-alive connection: a network connection kept open so several requests can travel over it in sequence.
- Parser state: a server's internal bookkeeping about how far through a message it has read.
- Security boundary: the line between what the proxy checks and what the back-end trusts.
- Forced browsing: requesting pages or addresses you are not authorised to see, hoping the server hands them over anyway.
- Access control bypass: getting past the checks that decide who may do what.
- Cache poisoning: making a cache store wrong content so other users are served it.
- WAF: web application firewall, a filter that inspects traffic for attacks.
- RFC 7230: the HTTP specification document that defines how messages are framed.
- CVSS: a standard scoring system that turns a vulnerability's characteristics into a severity number from 0 to 10.
- Attack Vector, Attack Complexity, Privileges Required, User Interaction, Scope, Confidentiality, Integrity, Availability: the individual CVSS metrics that make up the score.
proxy_pass: the nginx configuration directive that forwards requests to the back-end.proxy_request_buffering: an nginx setting that makes it read the whole request before forwarding it.proxy_http_version: an nginx setting choosing which HTTP version is used towards the back-end.- ALPN: the part of the connection handshake where client and server agree which HTTP version to use.
- Normalisation: rewriting incoming data into one standard form so every component reads it the same way.
- 404: the HTTP status code meaning "not found".
- Proxy tool: a program that sits between your browser and a site so you can read and edit requests by hand.