From 838d3da86d5cc40ec04ac25368f93a35a7baa4ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 11 Jan 2023 16:40:54 -0500 Subject: [PATCH] fix: backport socket.io vulnerability fix --- src/socket.io/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/socket.io/index.js b/src/socket.io/index.js index b77edbb57d..60c7a8cd27 100644 --- a/src/socket.io/index.js +++ b/src/socket.io/index.js @@ -123,7 +123,7 @@ async function onMessage(socket, payload) { const parts = eventName.toString().split('.'); const namespace = parts[0]; const methodToCall = parts.reduce((prev, cur) => { - if (prev !== null && prev[cur]) { + if (prev !== null && prev[cur] && (!prev.hasOwnProperty || prev.hasOwnProperty(cur))) { return prev[cur]; } return null;