> 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/http2-splitting-via-crlf-injection.md).

# HTTP/2 Request Splitting via CRLF Injection

HTTP/2 Request Splitting via CRLF Injection notes for PortSwigger Web Security Academy labs, including exploitation workflow, payload testing, Burp Suite validation, and remediation context.

### HTTP/2 Request Splitting via CRLF Injection

The front-end downgrades HTTP/2 requests to HTTP/1 and does not properly clean the headers. / This flaw allows a request splitting attack, used here to poison the response line and access the administration panel to remove user **carlos**. / An administrator connects every **10 seconds** and the back-end connection is reset every **10 requests**, making it easy to get back on a clean connection.

* Even if the query is poorly formed, the server does not return any error message.
* Example of attempt in HTTP/2:

```http
POST / HTTP/2
Host: 0a28000a0454ccd8800dee4e00990069.web-security-academy.net
Tranfer-Encoding: chunked

3
abc
X


```

No errors are generated.

* Added a custom header to **Request Headers** (Burp):

```http
Name:
test
Value:
test
Transfer-Encoding: chunked
```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-935c4ef1c926f31a3b5b47e05300d3216a497303%2F%7B0A5FD0EE-1A91-458D-9F1E-BBD73ABC0F88%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

* With a GET request containing a body, the server specifies that GET cannot carry a body, which confirms that some validations exist but remain insufficient for injected headers.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-324e8b0b2fb8d1e8e3846644b00a8374d4a06aea%2F%7BA0203264-F761-42F9-8C20-92EC37260A94%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### CRLF Injection via HTTP/2 Headers

By placing the headers controlled via HTTP/2, the CRLF injection is accepted. / You can then insert an additional query after the legitimate request during the downgrade to HTTP/1.

Example smuggled payload:

```http
GET / HTTP/2
Host: 0a28000a0454ccd8800dee4e00990069.web-security-academy.net


```

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-3ffcf22181c622a73c84a0fdd1636bdaa0db33df%2F%7B4A6F694D-B7C1-4688-B640-C53605E37F17%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4e513dbd7b850aac4a3c6d3100807b5b21efa565%2F%7B45299CA4-8B92-438C-A16A-81248ADC504E%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### Exploitation

1. Inject a smuggled query targeting:/ **GET / HTTP Admin/1.1**

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-bdce480abc23eb74c8d4c9b3a0e1a6a25d1f0a2d%2F%7B48C15764-C6B1-414B-9F0F-41B2496BB7FB%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

* Send multiple requests so that the administrator triggers the trapped response.

```http
test

GET /admin HTTP/1.1
Host: 0a28000a0454ccd8800dee4e00990069.web-security-academy.net
```

* Intercept the back-end request /admin containing the \*\* admin session cookie\*\*.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-bdc043221b4f5518382bcacdaab41a4364fd0bb9%2F%7B5B9706DF-9860-4B02-859D-1CBB6797028D%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

1. Reuse this stolen session to access the admin panel.
2. From the panel, delete user **carlos**.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-70978bd19c8c4e0b2251aa61f80c9d3e886a6066%2F%7BCAD15DFB-815C-443B-B0AB-28ABAA1E0FFC%7D.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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/http2-splitting-via-crlf-injection.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.
