GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 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

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 #2082

New issue
Copy link
New issue
Copy link
Closed
Closed
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#2082
Copy link
Assignees
dezren39
Labels
app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Oct 29, 2026
Issue body actions

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 of handlers decodes or reads r.Body with no ceiling at all, and there is no global cap: the two http.Servers (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.

Verified on main 264ba11549ddff607a38c72ff043e0cd0e7ef247:

Unbounded body reads (no MaxBytesReader, no limit):

  • routes_proxy.go:44 — handleChatCompletions: io.ReadAll(r.Body) buffers the whole chat-completions request in memory
  • upgrade.go:106 — handleUpgrade: io.ReadAll(r.Body)
  • routes_consumer.go:45 — handleDiagnose: json.NewDecoder(r.Body).Decode
  • routes_consumer.go:203 — handleRecipeSave: same
  • routes_consumer.go:278 — handleRecipeRun: same
  • routes_consumer.go:369 — handleIntent: same
  • routes_embeddings.go:40 — handleEmbeddings: same
  • routes_exec.go:218 — handleExec: same
  • routes_feedback.go:32 — handleFeedbackSubmit: same
  • server.go:616 — POST /v1/prompt handler: same

Bounded siblings (the house pattern these miss):

  • server.go:870 (http.callBodyLimit), server.go:963, server.go:1083 (http.bodyLimit), server.go:1100 (http.controlBodyLimit)
  • routes_secrets.go:49,114 (http.bodyLimit), routes_settings.go:200 (http.controlBodyLimit), routes_settings.go:588, ops.go:336
  • routes_proto.go:400 (defaults.HTTPCallBodyLimit), routes_proto.go:627, routes_proto.go:879

Why it matters

The 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.ReadAlls 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).

Acceptance criteria

  • 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).
  • An over-limit body gets a clean client error (400/413) and the daemon's memory stays bounded — no partial decode, no panic.
  • 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.
  • A guard (test or lint-style check, in the spirit of mcpx: a promise and a behaviour that disagree — every declared surface needs a guard that walks it (tracker) #1893 / mcpx testing: guard tests that close a whole bug class #1971) fails when a daemon handler reads r.Body without a ceiling, so the next route cannot reintroduce the gap.
  • Existing daemon test suites pass unchanged.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    on Oct 29, 2026
  2. developing-today commented on Oct 29, 2026

    @developing-today
    developing-todayBot
    on Oct 29, 2026 – with developing.today
    Contributor
    More actions

    CODE-997

  3. dezren39
    added
    queue/queuedHas a queued queue task
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Oct 29, 2026
  4. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (new-issue-creator-code-a)
    • Session / ID: cron new-issue-creator-code-a run 2026-10-28 20:35 CDT
    • Found via: filed this run
    • Task: Filed after verifying on main 264ba115 that a second set of mcpx daemon handlers reads request bodies with no size ceiling while sibling routes enforce the configured http.*BodyLimit caps via http.MaxBytesReader: unbounded io.ReadAll at routes_proxy.go:44 (chat completions) and upgrade.go:106; unbounded json.NewDecoder(r.Body) at routes_consumer.go:45/203/278/369, routes_embeddings.go:40, routes_exec.go:218, routes_feedback.go:32, server.go:616 (POST /v1/prompt). No global cap exists (server.go:307,360 set only ReadHeaderTimeout). Dedup: title+keyword search over open and closed issues — nearest mcpx(settings): byte sizes accept negatives and int64 overflow — http.streamBufferInit=-1 passes validation, then panics the CLI with 'makeslice: cap out of range' at the first streaming read #1697 (settings byte-size validation, distinct) and mcpx: a promise and a behaviour that disagree — every declared surface needs a guard that walks it (tracker) #1893 (guard tracker, this is a concrete instance).
    • Expectation: effort/s — triage pins the route-class limit for each handler (call/control/body), then a small fix wraps the enumerated handlers and adds a guard so a new unbounded body reader fails CI.
    • Links: packet hidden_files/queue-pilot/packet-2082-triage.json (repo-health-code-pilot, triage); body hidden_files/issue-code-mcpx-daemon-body-limits-body.md
  5. github-actions
    assigned
    dezren39
    on Oct 29, 2026
  6. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  7. 3 remaining items

  8. dezren39
    added
    queue/queuedHas a queued queue task
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  9. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), Lane B
    • Session / ID: queue task 5079 (small_fix, 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 #2082)
    • Found via: queue claim, 2026-11-01 ~06:00Z (packet from triage task 2968, same shift)
    • Task: Wrap the 10 unbounded daemon body readers with http.MaxBytesReader at the triage-pinned route classes, add over-limit tests (chat completions, exec, intent, upgrade) and the unbounded-reader guard.
  10. dezren39
    added a commit that references this issue on Nov 1, 2026

    Merge pull request #3370 from developing-today/queue/5079-2082-body-l…

    ee8bc80
  11. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done — fixed and merged

    • Agent: queue worker (repo-worker-code), Lane B
    • Session / ID: queue task 5079 (small_fix, 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 #2082), 2026-11-01
    • PR: fix(mcpx/daemon): MaxBytesReader ceilings for the unbounded body readers (#2082) #3370 — MERGED 2026-11-01T06:18:19Z, merge commit ee8bc80c18fe30c7e1f70989d9e8342f1c110a59 (branch queue/5079-2082-body-limits, commit bf851eb81)
    • What landed: all 10 enumerated handlers wrapped in http.MaxBytesReader at the triage-pinned classes (call: chat completions, embeddings, exec, intent, recipe run; body: diagnose, recipe save, feedback, POST /v1/prompt; control: upgrade), plus one extra site found in implementation — handleEmbeddingsImport handing r.Body to the whole-body VectorIndex.Import decode (call class). Over-limit surfaces as 400 through each handler's existing error path, matching the bounded routes; no status codes changed. Limits resolve via a new nil-safe Server.bodyBytes helper (the handleBatch fallback shape) — without it the wraps nil-panicked in existing bare-&Server{} tests; the four pre-existing server.go wraps moved onto the same helper.
    • Tests (laptop, per fleet CI-first/laptop policy): go vet ./internal/daemon/ clean; new body_limits_test.go (over-limit 400s for chat/exec/intent/upgrade, under-limit unchanged, TestNoUnboundedBodyReaders guard) passes; full internal/daemon suite passes (ok 129.719s). Codex review on fix(mcpx/daemon): MaxBytesReader ceilings for the unbounded body readers (#2082) #3370 completed with no findings.
    • Closing this issue as completed by fix(mcpx/daemon): MaxBytesReader ceilings for the unbounded body readers (#2082) #3370.
  12. dezren39
    closed this as completedon Nov 1, 2026
  13. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.