Bound HTTP/1 request metadata queue under pipelining

Aperta
#31 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
rust
Ambito
networking

Direzione di ricerca

Inizia in src/http_proxy.rs, in proxy_http1_rewriting e rewrite_request_stream, quindi traccia come i metadati della richiesta corrispondono alle richieste ordinarie, HEAD, alle risposte provvisorie 1xx, Upgrade e CONNECT. Esegui i test esistenti di riscrittura HTTP/1 prima di aggiungere un test upstream con risposta trattenuta che dimostri che i metadati rimangono entro i limiti, e includi il caso di rifiuto MAX_HEADER_SIZE + 1 per il limite esatto di 64 KiB.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Follow-up from the post-merge review of #23.

Problem

The HTTP/1 rewriting path creates a tokio::sync::mpsc::unbounded_channel for request/response correspondence. rewrite_request_stream queues one RequestMeta before every forwarded request.

If an upstream continues reading requests but delays its responses, an unauthenticated client can pipeline requests indefinitely. The request pump continues adding metadata while the response pump cannot drain it, allowing per-connection memory growth without a defined bound.

This affects routes using HTTP header rewriting for X-Forwarded-For or JA3/JA4 forwarding.

Location

  • src/http_proxy.rs: proxy_http1_rewriting, rewrite_request_stream
  • Introduced by #23 while fixing Upgrade/CONNECT response correspondence.

Acceptance criteria

  • Replace the unbounded metadata channel with bounded backpressure or enforce a documented maximum number of outstanding pipelined requests.
  • The request pump must stop advancing when the response side reaches that limit.
  • Preserve correct correspondence for ordinary requests, HEAD, interim 1xx responses, Upgrade, and CONNECT.
  • Add a test with an upstream that reads requests but withholds responses, proving queued metadata remains bounded.
  • Include the exact 64 KiB request-header boundary in the test cleanup: MAX_HEADER_SIZE + 1 must be rejected rather than relying on the current 70 KiB case.
Lingua principale
Rust
Stelle
1
Fork
0
Merge medio
19h 12m
PR unite (30g)
13

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di HarperFast/symphony

Tutte le issue di HarperFast/symphony

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.