fix(runtime): use more null proto objects (#23921)

This is a primordialization effort to improve resistance against users
tampering with the global `Object` prototype.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
Luca Casonato 2024-05-23 00:03:35 +02:00 committed by GitHub
parent 6c167c64d6
commit 971f09abe4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 141 additions and 92 deletions

View file

@ -300,7 +300,7 @@ class Request {
* @param {RequestInfo} input
* @param {RequestInit} init
*/
constructor(input, init = {}) {
constructor(input, init = { __proto__: null }) {
if (input === _brand) {
this[_brand] = _brand;
return;