From a4b8c1379806ccc9de694eca210f9470e079bab6 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 16 Aug 2021 07:12:22 -0700 Subject: [PATCH] events: protect property defs against prototype polution Signed-off-by: James M Snell PR-URL: https://github.com/nodejs/node/pull/39773 Reviewed-By: Antoine du Hamel --- lib/internal/worker/io.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/internal/worker/io.js b/lib/internal/worker/io.js index 9ec95509b56778..5d03f43ef6df62 100644 --- a/lib/internal/worker/io.js +++ b/lib/internal/worker/io.js @@ -142,6 +142,7 @@ ObjectDefineProperties(MessageEvent.prototype, { }, enumerable: true, configurable: true, + set: undefined, }, origin: { get() { @@ -151,6 +152,7 @@ ObjectDefineProperties(MessageEvent.prototype, { }, enumerable: true, configurable: true, + set: undefined, }, lastEventId: { get() { @@ -160,6 +162,7 @@ ObjectDefineProperties(MessageEvent.prototype, { }, enumerable: true, configurable: true, + set: undefined, }, source: { get() { @@ -169,6 +172,7 @@ ObjectDefineProperties(MessageEvent.prototype, { }, enumerable: true, configurable: true, + set: undefined, }, ports: { get() { @@ -178,6 +182,7 @@ ObjectDefineProperties(MessageEvent.prototype, { }, enumerable: true, configurable: true, + set: undefined, }, });