Title: mcpx(daemon): a second set of routes reads request bodies with no size ceiling — chat completions, exec, intent, upgrade and five more bypass the configured http.*BodyLimit caps · Issue #2082 · developing-today/code · GitHub
Open Graph Title: mcpx(daemon): a second set of routes reads request bodies with no size ceiling — chat completions, exec, intent, upgrade and five more bypass the configured http.*BodyLimit caps · Issue #2082 · developing-today/code
X Title: mcpx(daemon): a second set of routes reads request bodies with no size ceiling — chat completions, exec, intent, upgrade and five more bypass the configured http.*BodyLimit caps · Issue #2082 · developing-today/code
Description: Problem The mcpx daemon enforces its configured HTTP request-body ceilings (http.bodyLimit / http.callBodyLimit / http.controlBodyLimit, defaults in pkgs/mcpx/internal/defaults/defaults.go:162,186-195) on only some routes. A second set o...
Open Graph Description: Problem The mcpx daemon enforces its configured HTTP request-body ceilings (http.bodyLimit / http.callBodyLimit / http.controlBodyLimit, defaults in pkgs/mcpx/internal/defaults/defaults.go:162,186-...
X Description: Problem The mcpx daemon enforces its configured HTTP request-body ceilings (http.bodyLimit / http.callBodyLimit / http.controlBodyLimit, defaults in pkgs/mcpx/internal/defaults/defaults.go:162,186-...
Opengraph URL: https://github.com/developing-today/code/issues/2082
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcpx(daemon): a second set of routes reads request bodies with no size ceiling — chat completions, exec, intent, upgrade and five more bypass the configured http.*BodyLimit caps","articleBody":"## Problem\n\nThe mcpx daemon enforces its configured HTTP request-body ceilings (`http.bodyLimit` / `http.callBodyLimit` / `http.controlBodyLimit`, defaults in `pkgs/mcpx/internal/defaults/defaults.go:162,186-195`) on only some routes. A second set of handlers decodes or reads `r.Body` with no ceiling at all, and there is no global cap: the two `http.Server`s (`pkgs/mcpx/internal/daemon/server.go:307,360`) set only `ReadHeaderTimeout`, with no `MaxBytesHandler`. The defaults module's own comment states the intent — the ceiling was unified precisely because it used to differ per route — but the unification never reached these handlers.\n\nVerified on main `264ba11549ddff607a38c72ff043e0cd0e7ef247`:\n\n**Unbounded body reads (no `MaxBytesReader`, no limit):**\n- `routes_proxy.go:44` — `handleChatCompletions`: `io.ReadAll(r.Body)` buffers the whole chat-completions request in memory\n- `upgrade.go:106` — `handleUpgrade`: `io.ReadAll(r.Body)`\n- `routes_consumer.go:45` — `handleDiagnose`: `json.NewDecoder(r.Body).Decode`\n- `routes_consumer.go:203` — `handleRecipeSave`: same\n- `routes_consumer.go:278` — `handleRecipeRun`: same\n- `routes_consumer.go:369` — `handleIntent`: same\n- `routes_embeddings.go:40` — `handleEmbeddings`: same\n- `routes_exec.go:218` — `handleExec`: same\n- `routes_feedback.go:32` — `handleFeedbackSubmit`: same\n- `server.go:616` — `POST /v1/prompt` handler: same\n\n**Bounded siblings (the house pattern these miss):**\n- `server.go:870` (`http.callBodyLimit`), `server.go:963`, `server.go:1083` (`http.bodyLimit`), `server.go:1100` (`http.controlBodyLimit`)\n- `routes_secrets.go:49,114` (`http.bodyLimit`), `routes_settings.go:200` (`http.controlBodyLimit`), `routes_settings.go:588`, `ops.go:336`\n- `routes_proto.go:400` (`defaults.HTTPCallBodyLimit`), `routes_proto.go:627`, `routes_proto.go:879`\n\n## Why it matters\n\nThe daemon listens on loopback TCP + a unix socket. Any local process — or any local client with a bug, e.g. a runaway script POSTing an ever-growing prompt/exec/chat body — can make the daemon buffer an unbounded request body and OOM the process that every other tool call depends on. `handleChatCompletions` is the worst case: it `io.ReadAll`s the entire body before parsing. The configured ceilings exist and are already honoured on the call/proto/secrets routes; the gap is pure inconsistency, and it is exactly the class #1893 asks to be guarded (a declared surface — \"every body is capped\" — with no guard walking it). Related but distinct: #1697 (settings byte-size values themselves accept negatives/overflow).\n\n## Acceptance criteria\n\n- [ ] Every daemon HTTP handler that reads a request body enforces a configured ceiling (`http.MaxBytesReader` or equivalent) with the limit for its route class (call / control / body), closing the enumerated list above; triage pins which class each route takes where ambiguous (chat completions and exec are call-shaped; upgrade/diagnose/recipes/intent/embeddings/feedback/prompt need an explicit ruling).\n- [ ] An over-limit body gets a clean client error (400/413) and the daemon's memory stays bounded — no partial decode, no panic.\n- [ ] Tests: an over-limit request to representative previously-unbounded routes (at least chat completions, exec, intent, upgrade) is refused; under-limit requests to those routes behave exactly as before.\n- [ ] A guard (test or lint-style check, in the spirit of #1893 / #1971) fails when a daemon handler reads `r.Body` without a ceiling, so the next route cannot reintroduce the gap.\n- [ ] Existing daemon test suites pass unchanged.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-29T01:45:50Z","url":"https://github.com/developing-today/code/issues/2082"}
| 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:166d84df-5b1c-b941-d3c9-dbcc6f535686 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D4A0:D7B8A:8E6E5B:B820A0:6B062F7F |
| html-safe-nonce | 0b248d8f6a9ec9f23e020decb14e903a2a59bd7aaeae48989eec865f7281c273 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENEEwOkQ3QjhBOjhFNkU1QjpCODIwQTA6NkIwNjJGN0YiLCJ2aXNpdG9yX2lkIjoiNDMyNDM0NjM0Mjk3OTAyMjcxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 42a15806004ec9aa87fc03433faf5eac09389b50d97eb7ad18655d7db30919d9 |
| hovercard-subject-tag | issue:6090978500 |
| 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/2082/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dce77b730442015fd8d3cdb28a80240ad6abd343eb119e39517f1a7f8fedde5a/developing-today/code/issues/2082 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dce77b730442015fd8d3cdb28a80240ad6abd343eb119e39517f1a7f8fedde5a/developing-today/code/issues/2082 |
| og:image:alt | Problem The mcpx daemon enforces its configured HTTP request-body ceilings (http.bodyLimit / http.callBodyLimit / http.controlBodyLimit, defaults in pkgs/mcpx/internal/defaults/defaults.go:162,186-... |
| 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 | 7f961de5dd5c5d4aca24d33f8b3ffb3fb8b2ef53d0a4f32f01f0a790e512f6d3 |
| 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 | 494ea0bb1e0feef734a83e2628697647755e8864 |
| 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