> 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/ja/web/request-smuggling/queue-poisoning-with-h2-te.md).

# H2.TEによるキューポイズニング

PortSwigger Web Security Academy のラボ向けメモ。H2.TEによるキューポイズニングに関するもので、攻撃手順、ペイロードのテスト、Burp Suite による検証、および対策の文脈を含む。

### H2.TE リクエストスマグリングによるレスポンスキュー汚染

* リクエストスマグリングの脆弱性を利用してレスポンスキューを汚染する。
* この汚染を利用して〜にアクセスする `/admin` 管理パネルにアクセスします。
* 接続してきたら管理者のリクエスト（ひいてはそのセッションCookie）を取得し、その後、削除する `carlos` ユーザー。

#### 技術的背景

* アプリケーションはリクエストを受け付ける **HTTP/2** フロントエンド側。
* フロントエンドは **ダウングレードする** これらのHTTP/2リクエストをHTTP/1に変換する。長さが曖昧な場合でも同様である。
* この攻撃は、H2.TE型の非同期化に基づいている **H2.TE**:
* 以下の両方を含むHTTP/2リクエストを送信する:
* 1つの `Transfer-Encoding: chunked` ヘッダー
* 1つの `Content-Length` ヘッダー
* バックエンドへの接続は **10リクエストごとにリセットされる**:
* 接続が「壊れた」場合は、通常のリクエストをいくつか送って、クリーンな接続に戻すだけでよい。
* HTTP/2では、定義する必要はない `Content-Length` 通常はそうであり、そのため、同時に存在することを `Transfer-Encoding` および `Content-Length` 曖昧で利用可能にする。

#### 攻撃の流れ

```http
POST / HTTP/2
Host: 0afc007a0423d9b980403f2c00dd00d7.web-security-academy.net
Transfer-Encoding: chunked
Content-Length: 120

0

GET / HTTP/1.1
Host: 0afc007a0423d9b980403f2c00dd00d7.web-security-academy.net
Content-Length: 12

testing=test
```

* HTTP/2部分はフロントエンドに認識され、バックエンド向けにHTTP/1へ変換される。
* この曖昧さのため `H2.TE`、バックエンドはリクエストの終端を別の形で解釈する。
* その `GET / HTTP/1.1` 行とそれに続く部分は **こっそり注入される** バックエンド側の次のリクエストの開始として扱われる。

私たちは **汚染された管理者のリクエストを取得する**、これにより取得できるもの: その **セッションCookie**.

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f8cb9656f46ad61c65345f4030871c2a00e0f9c3%2F%7B606041C0-7B5F-4BC8-A64C-6FCDB7449828%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2001299964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ce994d5a72a05bd41fe1b2696e392f6acffc2e70%2F%7B856ABF65-A462-44BA-827E-E044AB503A36%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/ja/web/request-smuggling/queue-poisoning-with-h2-te.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.
