Title: 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 · GitHub
Open Graph Title: 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
X Title: 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
Description: 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-s...
Open Graph Description: 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 (ma...
X Description: 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...
Opengraph URL: https://github.com/developing-today/code/issues/2851
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"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","articleBody":"# 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\n\n## Evidence (main `f318fd59`)\n\nThe cost explorer's saved-setups store in `pm-stack/aggregator/src/render.ts` keeps setups in a plain object parsed from localStorage:\n\n- `loadSetups()` (:4321) returns `JSON.parse(localStorage.getItem(\"xpl-setups-v1\") || \"{}\")` — a plain object carrying `Object.prototype`.\n- Save handler (:4338): `all[name] = captureSetup();` then `storeSetups(all)` (:4324, `JSON.stringify`).\n- Import handler (:4359): `Object.keys(parsed).forEach(function (k) { all[k] = parsed[k]; });` then `storeSetups(all)`.\n\nAssignment `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:\n\n### Verified (laptop probe, verbatim save/import logic; `render.ts` md5 `2f629fd585f6f281cb3be63ce55ce337` on sandbox main, assignment lines identical in the laptop clone)\n\nProbe: `~/git/fleet/probe-2026-10-30-laneB-xplproto/` (`probe.mjs`, `probe2.mjs`)\n\nSave path:\n- save `Normal` → stored keys `[\"Normal\"]`\n- save `constructor` → stored keys `[\"Normal\",\"constructor\"]` (control: assignment *does* shadow for other prototype spellings)\n- 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.\n\nImport path (file text built as a raw string, the way FileReader delivers it):\n- `JSON.parse` itself preserves the entry: parsed own keys are `[\"__proto__\",\"Real\"]`.\n- 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.\n- The persisted JSON after import is `{\"Real\":{...}}` — the `__proto__` setup is silently dropped on import too.\n\n## Why it matters\n\n- 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.\n- The import path additionally mutates the in-memory store's prototype for the rest of that handler's lifetime.\n- This is the *write-side* counterpart of the own-key lookup design #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 #2828 (`bin/record.mjs` loose parser). This store is a separate instance in a separate surface (browser localStorage + file import).\n\n## Acceptance criteria\n\n- [ ] 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.\n- [ ] 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.\n- [ ] Controls unchanged: `Normal`, `constructor`, `toString` setup names save/import/export exactly as before.\n- [ ] A regression check covers the probe matrix (`__proto__`, `constructor`, ordinary name) across save → store → reload → export and across import.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-30T22:35:03Z","url":"https://github.com/developing-today/code/issues/2851"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:44eb3da1-de33-b23c-4138-615efd42790b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C000:287980:39B8B2:4DF820:6B0763D9 |
| html-safe-nonce | 41a92570f5d63891b5bb45a28f158cdaaa321cd4f185e37c942803b6ab3bd2c8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDAwOjI4Nzk4MDozOUI4QjI6NERGODIwOjZCMDc2M0Q5IiwidmlzaXRvcl9pZCI6IjUzNDk3MDgwOTYyODM4MjkyMDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f7a6ef6ade3d04f52e785c20d2ca8f4f450964a9d59cf17d9d94577a8f55cb5f |
| hovercard-subject-tag | issue:6128005934 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/2851/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e40c985843f8ff7c6ad8db9b690fb03314ce8b67972a520d8588e46447ff6493/developing-today/code/issues/2851 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e40c985843f8ff7c6ad8db9b690fb03314ce8b67972a520d8588e46447ff6493/developing-today/code/issues/2851 |
| og:image:alt | 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 (ma... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7a557ecc960a3ae6e299fc66b0bc9132072f8860191648e6749fee5d3ff00d82 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bd845eb7947c1ed8c850f7ab415a51339d162de3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width