Skip to content

reject prototype-polluting path segments in Path.set - #5756

Open
zayeem06 wants to merge 1 commit into
Polymer:masterfrom
zayeem06:path-set-proto-guard
Open

reject prototype-polluting path segments in Path.set#5756
zayeem06 wants to merge 1 commit into
Polymer:masterfrom
zayeem06:path-set-proto-guard

Conversation

@zayeem06

@zayeem06 zayeem06 commented Jul 1, 2026

Copy link
Copy Markdown

Reference Issue

N/A

Path.set walks a dotted path and assigns straight through each segment, so a path whose segments include __proto__, prototype, or constructor (for example __proto__.polluted or constructor.prototype.polluted) writes onto Object.prototype rather than the target object. This helper backs the element set()/notifyPath public API and the two-way binding change path, so an app that forwards an externally influenced path into set ends up polluting every object. The fix rejects those segments inside set and returns without writing, which keeps the pollution guard in the shared helper instead of at each call site. Legitimate paths are unaffected, and I added a regression case to test/unit/path.html that asserts the magic keys no-op while ordinary nested and top-level sets still work.

@zayeem06
zayeem06 requested a review from kevinpschaaf as a code owner July 1, 2026 06:33
@zayeem06

Copy link
Copy Markdown
Author

any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant