Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

HTTP CONNECT proxy tunnel has lax response parsing and loses early data

オープン
#4,095 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
networking

調査の方向性

src/client/legacy/connect/proxy/tunnel.rs の CONNECT 応答処理から始め、次に src/common/rewind.rs の private Rewind struct を読んでバッファリングのコンテキストを理解してください。handshake API を確認し、厳密な応答解析と保持された初期データをどのように表現すべきか判断してください。トンネルの確立後に不正な応答が拒否され、ターゲットサーバーのデータが保持されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

A-client C-bug E-pr-welcome K-hyper-util
Version

hyper-util 0.1.20

Platform

Linux 6.18.14

Summary

While evaluating hyper-util's client::legacy::connect::proxy::tunnel for use with gRPC routing over HTTP CONNECT proxies, I identified two limitations in the current handshake implementation.

1. Lax Response Parsing

It heuristically matches the start and end of the expected response, potentially accepting malformed responses.

This can be fixed by using httparse to properly parse the response.

2. No Buffering for Early Data

It assumes the read buffer contains no data from the target server immediately after the proxy's response. This assumption holds for protocols where the client always speaks first (e.g., TLS) after the tunnel is established. However, since gRPC implementations must work with any security protocol, they must handle cases where the server sends data immediately.

Fixing this would require an API change, as the returned I/O stream would need to incorporate a buffer for the peeked data, similar to the private Rewind struct.

Although the handshaking code is simple enough to be re-implemented in gRPC, I wanted to check if these fixes can be upstreamed to allow us to use hyper-util.

Code Sample

Expected Behavior
  • The proxy response must be correctly parsed.
  • The data from the target server must be retained.
Actual Behavior
  • A malformed proxy response may be accepted
  • The data from the target server may be lost.
Additional Context

No response

主要言語
Rust
スター
16.3k
フォーク
1.8k
平均マージ
1日 23時間
マージ済み PR(30日)
13

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hyperium/hyper のほかの issue

hyperium/hyper の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。