fix(config): restrict config paths to own properties#99846
Conversation
|
Land-ready proof for prepared head
No known proof gaps remain for the changed surface. |
|
Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 2:40 AM ET / 06:40 UTC. Summary PR surface: Source +4, Tests +44. Total +48 across 2 files. Reproducibility: yes. Source inspection of current main shows get, set, and unset can traverse inherited properties; I did not run tests in this read-only review. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Land this broader shared-helper own-property fix after exact-head gates, then close or reconcile the narrower predecessor PRs against the landed commit. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection of current main shows get, set, and unset can traverse inherited properties; I did not run tests in this read-only review. Is this the best way to solve the issue? Yes. Fixing the shared helper for get, set, and unset is narrower and more maintainable than caller-side checks or the unset-only predecessor. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cafbd745c1b1. Label changesLabel justifications:
Evidence reviewedPR surface: Source +4, Tests +44. Total +48 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
e526054 to
a3bf045
Compare
|
Merged via squash.
|
Co-authored-by: zenglingbiao <[email protected]>
Related: #99148
What Problem This Solves
Fixes an issue where config path operations could treat inherited object properties as persisted config. Reads could expose inherited values, unsets could report missing prototype-named keys as deleted, and sets could traverse inherited branches or invoke inherited descriptors instead of creating owned config data.
Why This Change Was Made
Config path reads, writes, and removals now operate on own properties only. Set operations define canonical enumerable, writable, configurable own properties, so inherited data, setters, getters, and non-writable descriptors cannot intercept config writes.
This completes the invariant identified by @zenglingbiao in #99148. The original fork disabled maintainer edits, so this replacement preserves the contributor as commit author while covering the full shared helper surface.
User Impact
Config show/unset behavior is accurate for prototype-named keys, and config mutations cannot follow, alter, or invoke inherited prototype state.
Evidence
node scripts/run-vitest.mjs src/config/config-paths.test.ts src/config/config-misc.test.ts src/config/runtime-overrides.test.ts- 106 tests passed..agents/skills/autoreview/scripts/autoreview --mode local --stream-engine-output- clean, no accepted/actionable findings, 0.94 confidence.tbx_01kwnxv1admc2fnvekh4gxm5k6:pnpm check:changedpassed for core and core tests, including typecheck, lint, import-cycle, and guard lanes.a3bf04584d44dc840e8186b926038e4e98a31321, based on landed main03fafe2364948dc58e63e7d28ebb36b432c23b4d.