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 — projector: read-API limit is never validated — ?limit=-1 returns the whole table and ?limit=2.7 500s the request · Issue #1547 · developing-today/code

projector: read-API limit is never validated — ?limit=-1 returns the whole table and ?limit=2.7 500s the request #1547

New issue
Copy link
New issue
Copy link
Closed
#2930
Closed
projector: read-API limit is never validated — ?limit=-1 returns the whole table and ?limit=2.7 500s the request#1547
#2930
Copy link
Assignees
dezren39
Labels
app/pm-stackpm-stack (Pad/Grist) in developing-today/codekind/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 28, 2026
Issue body actions

Summary

The projector's read API passes the limit query parameter to SQL LIMIT ? with no validation or clamp anywhere in the chain. ?limit=-1 (any negative) returns the entire table — SQLite treats a negative LIMIT as "no limit" — ?limit=1000000000 does the same in practice, ?limit=2.7 makes the driver throw a datatype-mismatch error (unhandled in the handler, so the request 500s), and ?limit=abc sends NaN to the driver. The defaults (200 / 500) only apply when the parameter is absent.

Evidence (verified this run on main a120b9a9)

  • pm-stack/projector/src/server.ts:119 — /items: limit: Number(url.searchParams.get("limit") ?? 200). Number("-1") is -1, Number("abc") is NaN, Number("2.7") is 2.7; nothing checks the result.
  • pm-stack/projector/src/server.ts:128 — /comments: same pattern with default 500, feeding both getCommentsForSubject and getComments.
  • pm-stack/projector/src/store.ts:188-191 — listItems: const limit = opts.limit ?? 200 — ?? only catches null/undefined, so -1, NaN and 2.7 all pass through into LIMIT ?. Same shape at store.ts:267 (getComments) and store.ts:283 (getCommentsForSubject).
  • SQLite semantics verified directly (python sqlite3, same SQLite core the libsql driver binds): LIMIT ? bound to -1 or -5 returned all 10 test rows; bound to 2.7 raised datatype mismatch; bound to 0 returned 0 rows.
  • The /items and /comments handlers (server.ts:110-141) have no try/catch (unlike /health and the webhook path), so the fractional-limit driver error escapes handleRequest as an unhandled 500 instead of a 400 naming the bad parameter.
  • No test covers a hostile limit: pm-stack/projector/test/ has no limit cases (grep).

These are read endpoints (no bearer token — server.ts only gates writes/reconcile), served on the projector's port and consumed by the aggregator's live source, so any local caller can force a full-table dump of pmp_items / pmp_comments with one parameter.

Why it matters

The limit parameter exists to bound response size; as written it bounds nothing. A negative or huge limit turns a paged read into an unbounded one (memory + payload blowup as the tables grow), and a fractional limit is a one-request 500. Every other numeric/structured input on this server is validated at the boundary (webhook HMAC + bounded body, link ref regex at server.ts:159) — limit is the loose one.

Acceptance criteria

  • limit is parsed once, at the HTTP boundary (or in the store functions), as a positive integer and clamped to a named per-endpoint maximum; absent → the existing defaults (200 items / 500 comments).
  • ?limit=-1, ?limit=0, ?limit=2.7, ?limit=abc and ?limit=999999999 can never produce an unbounded result or a 500: they get the default/clamp, or a 400 naming limit.
  • Tests at the store or handler level pin: negative → bounded, fractional/non-numeric → bounded or 400, over-max → max, ordinary ?limit=3 still returns exactly 3.
  • No behaviour change for well-formed callers (the aggregator's live reads use refs=, not limit).

Dedup

Searched open + closed issues for projector limit and related terms: no filing covers the projector read-API limit. Adjacent but in another repo/component: openchamber #604 (loose Number parsing in pool-health route — same defect family, different codebase), code #1485/#604-style aggregator sort issues (unrelated).

Activity

Next
  1. developing-today commented on Oct 28, 2026

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

    CODE-598

  2. dezren39
    added
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    on Oct 28, 2026
  3. dezren39 commented on Oct 28, 2026

    @dezren39
    dezren39
    on Oct 28, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane B, slug new-issue-creator-code-b)
    • Session / ID: cron job new-issue-creator-code-b, run 2026-10-27 19:57 CDT
    • Found via: filed this run
    • Task: Filed after verifying on main a120b9a that the projector read API passes Number(searchParams limit) straight to SQL LIMIT ? (server.ts:119,128; store.ts:188-191,267,283 — ?? default only catches null/undefined), and verifying SQLite semantics directly: a negative LIMIT bind returns all rows, a fractional bind (2.7) raises datatype mismatch, and the /items + /comments handlers have no try/catch so that error escapes as a 500. Enqueued as a triage packet to repo-health-code-pilot.
    • Expectation: triage (effort s) confirms and routes the fix: parse limit as a positive integer at one layer, clamp to a named per-endpoint max, pin negative/fractional/non-numeric/over-max tests.
    • Links: packet hidden_files/packet-1547.json
  4. github-actions
    assigned
    dezren39
    on Oct 28, 2026
  5. dezren39
    added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Oct 28, 2026
  6. 7 remaining items

  7. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Oct 31, 2026
  8. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), Lane A shift
    • Session / ID: queue task 1822
    • Found via: queue claim
    • Task: Validate/clamp the projector read-API limit parameter for /items and /comments per triage task 1601 ruling, with tests pinning negative/fractional/non-numeric/over-max/exact values.
    • Expectation: s — done = PR opened with the fix + tests, CI green, merged under standing criteria.
    • Links: issue projector: read-API limit is never validated — ?limit=-1 returns the whole table and ?limit=2.7 500s the request #1547; triage verdict projector: read-API limit is never validated — ?limit=-1 returns the whole table and ?limit=2.7 500s the request #1547 (comment)
  9. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Oct 31, 2026
  10. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: queue worker (repo-worker-code), Lane A shift
    • Session / ID: queue task 1822
    • Found via: queue claim
    • Task: PR fix(projector): validate and clamp read-API limit parameter (#1547) #2930 opened @f9850fdf9 — parseLimit() validates/clamps limit for /items and /comments (invalid → default 200/500, over-max → clamp 1000); new test/limit.test.ts pins negative/fractional/non-numeric/over-max/exact cases.
    • Expectation: parked 20 min on CI — no PR workflow run had started within 5 minutes (runner congestion); Codex code review already completed on the head with no findings; laptop verification: projector suite 43/43, limit tests 12/12. Resume: CI green for touched files → merge fix(projector): validate and clamp read-API limit parameter (#1547) #2930, close this issue, complete task 1822 as fixed_merged. The two failing jules-daily-* push workflows fail on every push including main — pre-existing, unrelated.
    • Links: PR fix(projector): validate and clamp read-API limit parameter (#1547) #2930 · branch queue/1822-1547-projector-limit
  11. dezren39
    added a commit that references this issue on Oct 31, 2026

    Merge pull request #2930 from developing-today/queue/1822-1547-projec…

    16bae8e
  12. dezren39
    closed this as completedin #2930on Oct 31, 2026
  13. dezren39
    removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Oct 31, 2026
  14. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), Lane A shift
    • Session / ID: queue task 1822
    • Found via: queue claim (resume after CI park)
    • Task: PR fix(projector): validate and clamp read-API limit parameter (#1547) #2930 merged — merge commit 16bae8e. On resume, fresh checks showed no PR workflow exists for pm-stack/** at all (only CodeRabbit + the pre-existing failing jules-daily-* push workflows), so there was no CI to wait for: merged under the standing criteria on laptop verification (projector suite 43/43, new limit tests 12/12) with Codex's review of the head completed clean. The CI-coverage gap is filed as ci: no pull_request workflow covers pm-stack/** — projector/aggregator changes merge with zero PR CI #2936.
    • Expectation: done — issue closed by the merge; task 1822 completed as fixed_merged.
    • Links: PR fix(projector): validate and clamp read-API limit parameter (#1547) #2930 · gap issue ci: no pull_request workflow covers pm-stack/** — projector/aggregator changes merge with zero PR CI #2936
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/pm-stackpm-stack (Pad/Grist) in developing-today/codekind/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.