Title: fleet-proxy(http): response reader caps every line but nothing caps repetition — endless 1xx heads, header lines, or trailer lines hang an exchange (and its pooled tunnel) forever · Issue #6509 · developing-today/code · GitHub
Open Graph Title: fleet-proxy(http): response reader caps every line but nothing caps repetition — endless 1xx heads, header lines, or trailer lines hang an exchange (and its pooled tunnel) forever · Issue #6509 · developing-today/code
X Title: fleet-proxy(http): response reader caps every line but nothing caps repetition — endless 1xx heads, header lines, or trailer lines hang an exchange (and its pooled tunnel) forever · Issue #6509 · developing-today/code
Description: Problem fleet-proxy's HTTP response reader (pkgs/fleet/crates/fleet-proxy/src/http.rs) bounds every unit a peer can send — one line is capped at MAX_LINE_BYTES (:52, enforced in read_line_bounded :143), a declared body is capped at MAX_R...
Open Graph Description: Problem fleet-proxy's HTTP response reader (pkgs/fleet/crates/fleet-proxy/src/http.rs) bounds every unit a peer can send — one line is capped at MAX_LINE_BYTES (:52, enforced in read_line_bounded :...
X Description: Problem fleet-proxy's HTTP response reader (pkgs/fleet/crates/fleet-proxy/src/http.rs) bounds every unit a peer can send — one line is capped at MAX_LINE_BYTES (:52, enforced in read_line_bound...
Opengraph URL: https://github.com/developing-today/code/issues/6509
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fleet-proxy(http): response reader caps every line but nothing caps repetition — endless 1xx heads, header lines, or trailer lines hang an exchange (and its pooled tunnel) forever","articleBody":"## Problem\n\n`fleet-proxy`'s HTTP response reader (`pkgs/fleet/crates/fleet-proxy/src/http.rs`) bounds every *unit* a peer can send — one line is capped at `MAX_LINE_BYTES` (:52, enforced in `read_line_bounded` :143), a declared body is capped at `MAX_RESPONSE_BODY_BYTES` before allocation — but nothing bounds *repetition*. Three loops consume peer-controlled units forever:\n\n1. **Interim 1xx heads** — `request()` (:215) loops `read_response_head()` and `continue`s on every 1xx (except 101) with no count limit.\n2. **Header lines** — `read_response_head()` (:282, loop at :305) reads header lines until a blank line with no line-count limit.\n3. **Chunked trailer lines** — `read_chunked()` (:355, trailer loop :369) reads trailer lines until a blank line with no line-count limit.\n\nA laptop service that is stuck, buggy, or hostile can therefore hang one broker exchange *indefinitely*: every unit arrives promptly, so the tunnel's 660 s per-read timeout (`tunnel.rs` `TUNNEL_READ_TIMEOUT`, applied per read syscall) never fires — each successful read starts a fresh window. The exchange holds its pooled tunnel (per-port pool, `serve.rs`) and broker thread the whole time; repeated requests to the same misbehaving service can pin the whole pool (default 50) one exchange at a time, with no error ever surfaced.\n\nThis is the one peer-trust gap left in a module whose stated doctrine (#5579, module doc :16-27) is that peer-declared sizes are never trusted: sizes are capped, counts are not.\n\n## Evidence (verified this run)\n\nProbe `~/git/fleet/probe-proxy-http` on the laptop (real `fleet-proxy` crate via path dependency, `http.rs` byte-identical at laptop HEAD and `origin/main` 85c435ec6c; loopback fake peer, `HttpConn::request` on a thread with a timed wait):\n\n- Control — peer sends one `100 Continue` head then `200 OK` with `Content-Length: 2`: **RETURNED status=200 body_len=2 in ~202µs**.\n- `flood1xx` — peer streams `HTTP/1.1 100 Continue\\r\\n\\r\\n` heads at 1 ms intervals: **STILL BLOCKED after 4s** (would run to the peer's 200,000-head budget and beyond).\n- `floodhdr` — peer sends `HTTP/1.1 200 OK\\r\\n` then streams `X-Fill: y\\r\\n` header lines: **STILL BLOCKED after 4s**.\n- `floodtrailer` — peer sends a chunked head + `0\\r\\n` then streams trailer lines: **STILL BLOCKED after 4s**.\n\nDedup: #5579 (closed) capped declared *sizes*; #5921 (closed) made 1xx interim heads consumed rather than returned — it introduced loop 1 without a bound. No open issue covers repetition/count bounds in this reader (searched: \"fleet-proxy 1xx\", \"interim response unbounded\", \"http.rs trailer\").\n\n## Why it matters\n\nThe broker is the fleet's single transport chokepoint to laptop services. A hang here is silent and unbounded — not a slow error but a permanently pinned tunnel and thread per exchange — and the trigger is exactly the peer this module already treats as untrusted for sizes. The failure mode also defeats the pool's bounded-wait design: slots are never returned, discarded, or timed out.\n\n## Acceptance criteria\n\n- Each repetition loop in the response reader has an explicit, named bound (interim-head count, header-line count per head, trailer-line count), sized generously above anything a legitimate laptop service sends, and exceeding it returns `HttpError::Malformed` and marks the connection non-reusable — the same failure shape as the existing size caps.\n- The probe cases above become tests in `http.rs`' loopback test style: a peer flooding 1xx heads / header lines / trailer lines errors out promptly; the control (one interim head, normal headers, normal trailers) still succeeds.\n- Legitimate behaviour is unchanged: #5921's HEAD/204/304/1xx semantics and #5579's size caps keep passing (`cargo test -p fleet-proxy` on the laptop or CI).\n- The module doc's peer-trust paragraph names the count bounds alongside the size bounds.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-06T12:06:28Z","url":"https://github.com/developing-today/code/issues/6509"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:54f6b731-b1f9-1cc3-d25b-237749a0eed1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 975A:EC78C:8696CD:B3A142:6B0634C5 |
| html-safe-nonce | 50e6551632fce99abbb41caf2f8ed4b72f03b9c4c5d519857d491bb255bf683a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzVBOkVDNzhDOjg2OTZDRDpCM0ExNDI6NkIwNjM0QzUiLCJ2aXNpdG9yX2lkIjoiMjk3MjUxMTgyNjM4NjY1NjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d8d74e2523f61d5eb960c40e15ad8b13c7a4cf6ed5cc390bd94ecbfc608c0d33 |
| hovercard-subject-tag | issue:6242342128 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/6509/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a913f2860f8dcaab700697b76f60615512d95b748f4cbbf21e80d472eae4da61/developing-today/code/issues/6509 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a913f2860f8dcaab700697b76f60615512d95b748f4cbbf21e80d472eae4da61/developing-today/code/issues/6509 |
| og:image:alt | Problem fleet-proxy's HTTP response reader (pkgs/fleet/crates/fleet-proxy/src/http.rs) bounds every unit a peer can send — one line is capped at MAX_LINE_BYTES (:52, enforced in read_line_bounded :... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | c3584c853cd39700ecff6e2cf8364295ffdb5313e571046c41cd2479270f7df0 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9eb3bb1597d09170a5f282cd38ae376dee1a5ec1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width