From df1c1874f6ad169c9f161f63e8890dc377423e7e Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sat, 22 Oct 2022 17:06:23 -0400 Subject: [PATCH] fs: avoid prototype pollution --- lib/internal/fs/watch/linux.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/fs/watch/linux.js b/lib/internal/fs/watch/linux.js index 415e513bbf7408..38fd3c6877f741 100644 --- a/lib/internal/fs/watch/linux.js +++ b/lib/internal/fs/watch/linux.js @@ -185,7 +185,7 @@ class FSWatcher extends EventEmitter { async next() { if (this.#closed) { - return { done: true }; + return { __proto__: null, done: true }; } const result = await new Promise((resolve) => { @@ -194,7 +194,7 @@ class FSWatcher extends EventEmitter { }); }); - return { done: false, value: result }; + return { __proto__: null, done: false, value: result }; } // eslint-disable-next-line require-yield