From b25f4bbe4abb69f839c8f4caef29a608404eb9f1 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 2 Jul 2020 18:26:45 -0300 Subject: [PATCH] Prevent manually connecting to extension UI (#8893) The `activeTab.id` property is relied upon in the connected sites modal to prevent the user from manually connecting to the MetaMask extension itself. Unfortunately the `id` property was never set. `id` is now set on the `activeTab` state, so manually connecting to the extension UI is now impossible. --- app/scripts/ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/scripts/ui.js b/app/scripts/ui.js index 3b7b6ea3c..822ea73a4 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -83,7 +83,7 @@ async function queryCurrentActiveTab (windowType) { extension.tabs.query({ active: true, currentWindow: true }, (tabs) => { const [activeTab] = tabs - const { title, url } = activeTab + const { id, title, url } = activeTab const { origin, protocol } = url ? new URL(url) : {} if (!origin || origin === 'null') { @@ -91,7 +91,7 @@ async function queryCurrentActiveTab (windowType) { return } - resolve({ title, origin, protocol, url }) + resolve({ id, title, origin, protocol, url }) }) }) }