| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Member descriptors are plain object literals that spell out only the members they need, so createDictionaryConverter() reading the optional validator, defaultValue and required members off them resolves through %Object.prototype%. Copy each descriptor once at construction time with every key present. They keep an ordinary prototype because a null-prototype object literal lands in V8 dictionary mode, and dictionaries with no defaults and no required members now skip steps 4.1.5 and 4.1.6. Signed-off-by: Filip Skokan <panva.ip@gmail.com>
BufferSource conversion hands over the caller's own object uncopied, so byteLength, byteOffset, buffer and length reads on it run user-replaceable prototype accessors. Internal lookup tables are indexed with computed keys, so a polluted %Object.prototype% key answers a miss. The %Set% constructor iterates its argument through the user-mutable %Array.prototype% iterator. The algorithm registry and the hash name tables are detached from %Object.prototype% after construction rather than declared `__proto__: null`, which V8 places in dictionary mode. Signed-off-by: Filip Skokan <panva.ip@gmail.com>
|
Review requested:
|
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 98.96907% with 2 lines in your changes missing coverage. Please review.
@@ Coverage Diff @@
## main #65115 +/- ##
========================================
Coverage 90.29% 90.30%
========================================
Files 759 759
Lines 248295 248404 +109
Branches 46861 46872 +11
========================================
+ Hits 224205 224328 +123
+ Misses 15517 15509 -8
+ Partials 8573 8567 -6
... and 30 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
Sorry, something went wrong.
Member descriptors are plain object literals that spell out only the members they need, so createDictionaryConverter() reading the optional validator, defaultValue and required members off them resolves through %Object.prototype%. Copy each descriptor once at construction time with every key present. They keep an ordinary prototype because a null-prototype object literal lands in V8 dictionary mode, and dictionaries with no defaults and no required members now skip steps 4.1.5 and 4.1.6. Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: #65115 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Aviv Keller <me@aviv.sh>
BufferSource conversion hands over the caller's own object uncopied, so byteLength, byteOffset, buffer and length reads on it run user-replaceable prototype accessors. Internal lookup tables are indexed with computed keys, so a polluted %Object.prototype% key answers a miss. The %Set% constructor iterates its argument through the user-mutable %Array.prototype% iterator. The algorithm registry and the hash name tables are detached from %Object.prototype% after construction rather than declared `__proto__: null`, which V8 places in dictionary mode. Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: #65115 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Aviv Keller <me@aviv.sh>
Member descriptors are plain object literals that spell out only the members they need, so createDictionaryConverter() reading the optional validator, defaultValue and required members off them resolves through %Object.prototype%. Copy each descriptor once at construction time with every key present. They keep an ordinary prototype because a null-prototype object literal lands in V8 dictionary mode, and dictionaries with no defaults and no required members now skip steps 4.1.5 and 4.1.6. Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: #65115 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Aviv Keller <me@aviv.sh>
BufferSource conversion hands over the caller's own object uncopied, so byteLength, byteOffset, buffer and length reads on it run user-replaceable prototype accessors. Internal lookup tables are indexed with computed keys, so a polluted %Object.prototype% key answers a miss. The %Set% constructor iterates its argument through the user-mutable %Array.prototype% iterator. The algorithm registry and the hash name tables are detached from %Object.prototype% after construction rather than declared `__proto__: null`, which V8 places in dictionary mode. Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: #65115 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Aviv Keller <me@aviv.sh>
| Back | FazBrowse Home | New Git URL |
A pass over the Web Crypto implementation from a primordials perspective, continuing where #63363 left off. That one covered the promise/thenable side, this covers input validation and normalization.
Per our threat model, prototype pollution requiring control over user input is not a vulnerability so this is hardening and spec-fidelity work rather than a security fix.
Three things covered:
The obvious (__proto__: null) fix regresses badly: V8 creates __proto__: null object literals in dictionary mode and constant-folds absent-property loads through a stable %Object.prototype% chain. Applied naively that cost -88% on webidl-dict-null and -24% on normalizeAlgorithm-string. Instead, tables are detached with ObjectSetPrototypeOf() after construction, options and descriptors spell out every key they read, and dictionaries needing no missing-member handling skip those reads.
benchmark/misc/webcrypto-webidl, 25 runs, medians:
All within noise.