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 — pm-stack(dispatch): readJsonBody buffers the entire body before enforcing its 256 KiB cap · Issue #10646 · developing-today/code

pm-stack(dispatch): readJsonBody buffers the entire body before enforcing its 256 KiB cap #10646

New issue
Copy link
New issue
Copy link
Closed
#10751
Closed
pm-stack(dispatch): readJsonBody buffers the entire body before enforcing its 256 KiB cap#10646
#10751
Copy link
Labels
kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:done

Description

@dezren39
dezren39
opened on Nov 16, 2026
Issue body actions

Evidence

pm-stack/dispatch/src/server.ts:65-76 (verified on origin/main):

async function readJsonBody(req: Request): Promise<unknown> {
  const text = await req.text();            // :66 — unbounded buffer
  if (new TextEncoder().encode(text).length > MAX_BODY_BYTES) throw ...

MAX_BODY_BYTES = 256*1024 (:55) is checked only after req.text() has materialised the whole body. A 100 MiB POST is fully buffered before it is rejected. Used by POST intake paths (:198, :420 — session/task creation). The path is authenticated (GitHub Actions OIDC or static bearer, :16-17, binds loopback + laptop tailnet) so this is robustness, not an unauthenticated DoS — but one misbehaving/buggy client can still OOM or stall the intake.

Why it matters

The repo already has the bounded pattern to copy: streaming reader.read() + byteLength > cap → cancel in pm-stack/aggregator/src/request-body.ts:13-27, and readBoundedBody(req.body, 10_000_000) in pm-stack/projector/src/server.ts:257 / webhook.ts:7-29 (landed via #10638). Dispatch is the remaining intake that buffers first and checks second.

Acceptance criteria / suggested fix

Check the content-length header first, then bounded streaming read with early reader.cancel() and 413/400 "body: too large" — never await req.text() on an unbounded stream. Add a test posting > 256 KiB and asserting rejection without full buffering (mirror the projector write-bounds.test.ts approach).

Deduped: gh search issues for dispatch body limits returns nothing; the sibling projector bounds (#10595/#10601/#10635, all fixed via #10602/#10638) are a different service; no open PR touches dispatch server.ts. Verified against origin/main 81d10205bf (read-only worktree).

Activity

  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    on Nov 16, 2026
  2. developing-today commented on Nov 16, 2026

    @developing-today
    developing-todayBot
    on Nov 16, 2026 – with developing.today
    Contributor
    More actions

    CODE-3864

  3. developing-today
    added
    status:in-review
    on Nov 16, 2026
  4. dezren39
    closed this as completedin #10751on Nov 16, 2026
  5. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:done

    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.