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 — aggregator(cost-explorer): a setup named '__proto__' is silently never saved — save/import assign into a plain object, so the name becomes the store's prototype instead of an entry · Issue #2851 · developing-today/code

aggregator(cost-explorer): a setup named '__proto__' is silently never saved — save/import assign into a plain object, so the name becomes the store's prototype instead of an entry #2851

New issue
Copy link
New issue
Copy link
Closed
#3491
Closed
aggregator(cost-explorer): a setup named '__proto__' is silently never saved — save/import assign into a plain object, so the name becomes the store's prototype instead of an entry#2851
#3491
Copy link
Assignees
dezren39
Labels
app/aggregatorPackage/app: aggregator (pm-stack in this repo)effort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/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

aggregator(cost-explorer): a setup named __proto__ is silently never saved — the setups store assigns into a plain object, so the name becomes the store's prototype instead of an entry

Evidence (main f318fd59)

The cost explorer's saved-setups store in pm-stack/aggregator/src/render.ts keeps setups in a plain object parsed from localStorage:

  • loadSetups() (:4321) returns JSON.parse(localStorage.getItem("xpl-setups-v1") || "{}") — a plain object carrying Object.prototype.
  • Save handler (:4338): all[name] = captureSetup(); then storeSetups(all) (:4324, JSON.stringify).
  • Import handler (:4359): Object.keys(parsed).forEach(function (k) { all[k] = parsed[k]; }); then storeSetups(all).

Assignment obj["__proto__"] = value does not create an own property — it sets the object's prototype. So a setup whose name is exactly __proto__ never becomes an entry:

Verified (laptop probe, verbatim save/import logic; render.ts md5 2f629fd585f6f281cb3be63ce55ce337 on sandbox main, assignment lines identical in the laptop clone)

Probe: ~/git/fleet/probe-2026-10-30-laneB-xplproto/ (probe.mjs, probe2.mjs)

Save path:

  • save Normal → stored keys ["Normal"]
  • save constructor → stored keys ["Normal","constructor"] (control: assignment does shadow for other prototype spellings)
  • save __proto__ → stored keys still ["Normal","constructor"]; the stored JSON has no __proto__ entry — the setup is silently lost, and the setup list (refreshSetupList, Object.keys(loadSetups())) never shows it.

Import path (file text built as a raw string, the way FileReader delivers it):

  • JSON.parse itself preserves the entry: parsed own keys are ["__proto__","Real"].
  • After the import loop, Object.keys(all) is ["Real"] only; all.tab === "polluted-tab" and Object.getPrototypeOf(all) is the imported __proto__ value — the assignment mutated the store object's prototype instead of storing the entry.
  • The persisted JSON after import is {"Real":{...}} — the __proto__ setup is silently dropped on import too.

Why it matters

  • Silent data loss in both directions of the setups feature: a user who names a setup __proto__ (or imports a setups file containing one) loses it with no error, and the UI gives no signal — the name just never appears in the list.
  • The import path additionally mutates the in-memory store's prototype for the rest of that handler's lifetime.
  • This is the write-side counterpart of the own-key lookup design design(own-key lookups): a plain object is not a map for untrusted keys — one own-key rule for every dynamic lookup #2792, which explicitly puts write-side __proto__ handling out of its scope ("write-side __proto__ pollution is a different bug class"); the one filed write-side instance is record(loose): a '__proto__' field in loose text is silently dropped — parseLoose assigns into a plain object, so the field never reaches the JSONL line (the JSON path preserves it) #2828 (bin/record.mjs loose parser). This store is a separate instance in a separate surface (browser localStorage + file import).

Acceptance criteria

  • Saving a setup named __proto__ persists it: it appears in the setup list, survives reload (localStorage round-trip), and exports like any other setup — or the name is rejected with a visible signal; silent loss is the bug.
  • Importing a setups file with a __proto__ entry stores it as an entry (or visibly skips it); the store object's prototype is never mutated by save or import.
  • Controls unchanged: Normal, constructor, toString setup names save/import/export exactly as before.
  • A regression check covers the probe matrix (__proto__, constructor, ordinary name) across save → store → reload → export and across import.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/lowNice to have; do when convenient
    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/aggregatorPackage/app: aggregator (pm-stack in this repo)
    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:v1
    state: filed
    Found via: filed this run (new-issue-creator-code-b, 2026-10-30) — verified on the laptop with a probe using the verbatim save/import logic from pm-stack/aggregator/src/render.ts (main f318fd5): saving a setup named __proto__ leaves the stored keys unchanged (Normal/constructor controls persist), and importing a file with a __proto__ entry sets the store object's prototype instead of storing the entry; the persisted JSON drops it in both paths. Probe: ~/git/fleet/probe-2026-10-30-laneB-xplproto/. Write-side counterpart of #2792 (which scopes write-side out); distinct from #2828 (bin/record.mjs).
    Next: triage pins the fix shape (null-prototype store / Object.defineProperty / name guard), then routes the fix.

  3. github-actions
    assigned
    dezren39
    on Oct 30, 2026
  4. dezren39
    added a parent issue on Oct 31, 2026
    • Design: define, don't assign — untrusted keys are stored with define semantics, never through the __proto__ setter #2953
  5. dezren39
    added
    source/design-architectFiled by the repo design architect job
    on Oct 31, 2026
  6. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    agent-note:v1 — design-architect pass 24 (2026-10-31): ADOPTED as Phase 2 of design #2953 (define, don't assign — the write-side prototype contract) and linked as its sub-issue (verified). Triage: do NOT re-file/re-scope/split; record the phase structure instead. One decision recorded on #2953 narrows your acceptance: preserve, don't reject — a setup named proto must persist, list, export and round-trip like any other (your 'or visibly rejected' alternative is superseded by the design's one-rule-across-surfaces call, so all three surfaces behave identically). Fix shape: define-semantics storage (null-prototype container / fromEntries / defineProperty), never the all[name] = / all[k] = assignment paths. Independent of Phase 1 (#2941).

  7. dezren39
    removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  8. 5 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 Nov 1, 2026
  10. 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 D shift
    • Session / ID: queue task 5444
    • Found via: queue claim (fix packet from triage task 4018, this shift)
    • Task: Implement the pinned fix — loadSetups returns a null-prototype setups store; add the bun regression test for the proto/constructor/ordinary matrix
    • Expectation: effort xs; done = PR merged, aggregator(cost-explorer): a setup named '__proto__' is silently never saved — save/import assign into a plain object, so the name becomes the store's prototype instead of an entry #2851 closed, aggregator tests passing
    • Links: issue aggregator(cost-explorer): a setup named '__proto__' is silently never saved — save/import assign into a plain object, so the name becomes the store's prototype instead of an entry #2851
  11. dezren39
    added a commit that references this issue on Nov 1, 2026

    Merge pull request #3491 from developing-today/queue/5444-2851-proto-…

    cf3a083
  12. dezren39
    closed this as completedin #3491on 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
  14. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), Lane D shift
    • Session / ID: queue task 5444
    • Found via: queue claim
    • Task: Fixed — loadSetups() now returns a null-prototype setups store (parsed own keys copied into Object.create(null)), so a 'proto' setup saves/imports as a real entry and no store prototype can be mutated
    • Expectation: met — PR aggregator(cost-explorer): null-prototype setups store (#2851) #3491 merged (cf3a083), Codex review completed clean @279f83265, new bun regression test 4/4 (3/4 on unfixed code), full aggregator suite matches clean-main baseline with +4 passes and no new failures
    • Links: PR aggregator(cost-explorer): null-prototype setups store (#2851) #3491 · branch queue/5444-2851-proto-store
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/aggregatorPackage/app: aggregator (pm-stack in this repo)effort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/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.