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-dispatch(validate): resolvePriority's plain-object lookup returns prototype members as priorities — 'constructor' becomes the Object constructor function and '__proto__' an object, instead of the documented 400 · Issue #2757 · developing-today/code

pm-dispatch(validate): resolvePriority's plain-object lookup returns prototype members as priorities — 'constructor' becomes the Object constructor function and '__proto__' an object, instead of the documented 400 #2757

New issue
Copy link
New issue
Copy link
Closed
#3105
Closed
pm-dispatch(validate): resolvePriority's plain-object lookup returns prototype members as priorities — 'constructor' becomes the Object constructor function and '__proto__' an object, instead of the documented 400#2757
#3105
Copy link
Assignees
dezren39
Labels
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes 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 jobsource/design-architectFiled by the repo design architect jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

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

Problem

pm-dispatch: resolvePriority resolves a named priority through a plain-object lookup with no own-key check, so two prototype spellings are accepted as priorities instead of failing with the documented 400 — and the value that reaches the queue is not a number at all.

pm-stack/dispatch/src/validate.ts:28-48 (main 58635f8d):

export const PRIORITY_NAMES: Record<string, number> = {
  critical: 10, high: 20, normal: 40, low: 70,
};
...
if (typeof input === "string") {
  const v = PRIORITY_NAMES[input.trim().toLowerCase()];
  if (v === undefined) { throw new ValidationError(`priority: unknown name ...`); }
  return v;
}

PRIORITY_NAMES["constructor"] is the Object constructor function and PRIORITY_NAMES["__proto__"] is Object.prototype — neither is undefined, so neither throws.

Verified (this run, real module)

Probe on the laptop (~/git/fleet/probe-2026-10-30-laneB-priorityproto/, validate.ts copied verbatim from main, md5 c1f61d5acf5c85da71de798f4c7056b8, run under bun 1.4.2):

input result
"high" / "normal" (controls) 20 / 40 (number) ✓
"bogus" (control) ValidationError 400 ✓
"constructor" returns the Object constructor function (typeof === "function")
"__proto__" returns Object.prototype (typeof === "object")
"toString" / "hasOwnProperty" 400 — they only escape because toLowerCase() changes their spelling; constructor/__proto__ are already lowercase

Downstream, through the real parseSessionRequest:

  • priority: "constructor" yields a session/task request whose priority field is a function. JSON.stringify({ p_priority: <that> }) produces {} — the field is silently dropped, so QueueClient.enqueue (src/queue.ts) sends the enqueue RPC with no p_priority at all instead of the request being rejected.
  • priority: "__proto__" serializes as p_priority: {}, an object where the RPC expects the design-scale integer.
  • buildPacket (src/packet.ts) interpolates the value into priority_reason ("resolved to function Object() { [native code] }…") and the /v1/tasks comment path interpolates it as [object Object].

So a documented-error case (unknown priority name → 400, validate.ts:36-38) instead becomes a dropped/mistyped queue priority and garbage provenance text — the request is never told its priority was invalid.

Why it matters

  • The priority is the queue's claim-ordering input (design scale 10–90, validate.ts:11-16). Silently dropping it or sending {} means a caller who typo'd — or probed — a name gets a task at whatever the RPC does with a missing/object priority, with no error anywhere.
  • This is the same own-key-lookup failure class as the aggregator weights lookup (aggregator(weights): effortWeight's plain-object lookup returns prototype members as weights — 'effort/constructor' counts as sized and string-poisons every weighted summary #2734), in the dispatcher's own request boundary — the one place whose whole job is validating requests before they become queue tasks / launched sessions (cf. design(pm-dispatch): launch pipeline, staged — validate the whole request at the boundary, one commit point, nothing after it can fail the launch #2668's boundary-validation design).

Acceptance criteria

  • resolvePriority("constructor") and resolvePriority("__proto__") (any case/whitespace variant that lowercases/trims to a prototype key) throw ValidationError (400, "unknown name"), like every other unknown name.
  • The fix uses an own-key check (e.g. Object.hasOwn / a Map / a null-prototype table) rather than a denylist of the two spellings, so no other inherited member can leak through.
  • Regression tests in pm-stack/dispatch/test/validate.test.ts: the two spellings above 400; the four real names and the numeric scale/snap behaviour are unchanged.
  • No non-number can reach Packet.priority / p_priority from a named priority: a test through parseSessionRequest/parseTaskRequest with priority: "constructor" 400s instead of producing a request object.

Dedup

Searched open + recently closed issues for resolvePriority, prototype/constructor priority, and dispatch priority validation. #2679 covers the composite actions sending a numeric priority as a JSON string (different mechanism, action side); #2734 is the same failure class in the aggregator's weights.ts (different module, already filed separately per app). No filing covers the dispatch lookup.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    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
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    effort/xsTrivial: expected under 30 minutes of work
    on Oct 30, 2026
  2. dezren39 commented on Oct 30, 2026

    @dezren39
    dezren39
    on Oct 30, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator (lane B, new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b, run 2026-10-30 08:50 CDT
    • Found via: filed this run
    • Task: Triage the resolvePriority prototype-lookup finding: pin the own-key fix shape, then route a small_fix packet.
    • Expectation: effort/xs — done when 'constructor'/'proto' 400 like other unknown names, with regression tests, and no non-number can reach Packet.priority.
    • Links: probe on laptop ~/git/fleet/probe-2026-10-30-laneB-priorityproto/ (real validate.ts, md5-matched to main 58635f8)
  3. github-actions
    assigned
    dezren39
    on Oct 30, 2026
  4. dezren39
    added a parent issue on Oct 30, 2026
    • design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792
  5. dezren39
    added
    source/design-architectFiled by the repo design architect job
    on Oct 30, 2026
  6. dezren39 commented on Oct 30, 2026

    @dezren39
    dezren39
    on Oct 30, 2026
    MemberAuthor
    More actions

    agent-note:v1 — design-architect pass 21 (2026-10-30): this issue is ADOPTED as Phase 3 of design #2792 ("own keys only — a plain object is not a map for untrusted keys", doc files/designs/code-own-key-lookups.md). It is linked as a sub-issue of #2792. Triage: do NOT re-file, re-scope, or split — record the phase structure instead. Phase decisions recorded on #2792: the fix is the own-key rule (Object.hasOwn at the read site — the #2787 embodiment, closed today in id/web); a prototype spelling must produce the documented 400, exactly like a genuinely unknown priority name. Phase 3 also carries the design's closing audit (inventory sweep for remaining plain-object tables indexed by dynamic keys, vendored assets excluded), which closes #2792 with its evidence — the audit belongs with this phase, not as a separate issue.

  7. dezren39
    removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Oct 31, 2026
  8. 4 remaining items

  9. 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 Oct 31, 2026
  10. 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 C shift
    • Session / ID: queue task 4373
    • Found via: queue claim
    • Task: Phase 3 of design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792: add the own-key guard (Object.hasOwn) to resolvePriority in pm-stack/dispatch/src/validate.ts so prototype spellings 400, add regression tests, and post the design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792 closing audit (closing design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792 once the fix lands).
    • Expectation: effort/xs fix + audit — done = PR merged, pm-dispatch(validate): resolvePriority's plain-object lookup returns prototype members as priorities — 'constructor' becomes the Object constructor function and '__proto__' an object, instead of the documented 400 #2757 closed, audit posted on design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792 and epic closed.
    • Links: packet task 4373; triage task 4012 CONFIRMED at main fa7e71b
  11. dezren39
    added a commit that references this issue on Oct 31, 2026

    Merge pull request #3105 from developing-today/queue/4373-2757-resolv…

    3f87244
  12. dezren39
    closed this as completedin #3105on Oct 31, 2026
  13. 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 C shift
    • Session / ID: queue task 4373
    • Found via: queue claim
    • Task: Done. PR pm-dispatch(validate): own-key guard in resolvePriority (#2757, #2792 Phase 3) #3105 merged (3f87244): Object.hasOwn guard in resolvePriority + regression tests (full dispatch suite 57/57 on laptop; Codex review completed, no findings). This issue auto-closed on merge.
    • Expectation: met — prototype spellings now take the documented unknown-name 400 at resolvePriority and at parse level for sessions/tasks.
    • Links: PR pm-dispatch(validate): own-key guard in resolvePriority (#2757, #2792 Phase 3) #3105 · design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792 closing audit: design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792 (comment) · audit follow-ups filed as own-key audit follow-ups (#2792 Phase 3): unguarded plain-object lookups on data/request-spelled keys in aggregator + bin proxies #3106 · note: design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792 stays open until Phase 1 (sync-models(policy): family validation is a prototype lookup — 'constructor'/'toString' pass and wipe a provider's models, group-less patterns crash unnamed #2790, fix task 4024) lands
  14. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Oct 31, 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/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes 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 jobsource/design-architectFiled by the repo design architect 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.