High watch CVSS 9.6 chrome UAF 📄 Reporter bug report 🔧 Commit mapped

Overview

High
Severity
9.6
CVSS
No
Exploited ITW
Fixed
Fix Status
ImpactUse after free in Extensions
DescriptionUse after free in Extensions
ComponentExtensions
Sub-componentExtensions
Bug ClassUAF
Action tierwatch — corruption primitive but gated (uncommon) — not default-reachable
Computed by PatchGap's deterministic exploitability ruler from the fixing commit. patch-now = RCE-class & attacker-reachable in a default config, or exploited in the wild; watch = real security signal below that bar; noise = no security relevance.
Tracker537109028
Fix commitc999d7506605 (chromium/src) +120/-14
CWECWE-416 (Use-after-free)
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
CISA KEVNot listed
CreditedGoogle
Reported2026-07-21 (per vendor advisory)
Fix landed2026-08-01 (public git)
Disclosed2026-08-25
Patch gap24 days — fix public in source before the advisory

Background

`windows.create()` / `tabs.create()`
These are extension APIs, implemented in chrome/browser/extensions/api/tabs/tabs_api.cc, that can create a new browser window and then show it focused, inactive, minimized or fullscreen.
`BrowserWindowInterface`
This is the browser-process abstraction for a browser window. The patch obtains a base::WeakPtr<BrowserWindowInterface> through GetWeakPtr(), which becomes null once the window object is destroyed.
`IsDeleteScheduled()`
This flag on BrowserWindowInterface shows that the window is being torn down and its deletion is pending, so it should not receive new work even though the object may still exist.
Re-entrancy during `Show()`
According to the commit message, on certain platforms and in certain conditions Show(), ShowInactive() and related calls can synchronously cause the window to close and destruct.

Root Cause Analysis

After creating a window, the windows.create handler held it in a raw new_window pointer, called GetWindow()->Show() or ShowInactive(), and then kept dereferencing new_window. It did this for the Linux/X11 minimize workaround, the ChromeOS locked-fullscreen path, the GetProfile()->IsOffTheRecord() check and ExtensionTabUtil::CreateWindowValueForExtension(). The tabs.create window-creation path did the same: it called browser->GetWindow()->Show() and then OpenTabInBrowser(*browser, opener). If showing the window caused it to close and be freed synchronously, every later use of the raw pointer was a use-after-free in the browser process. The code assumed that a window object survives its own Show() call, and that assumption does not hold.

The fix captures a WeakPtr and nulls the raw pointer before any show call. After showing, it returns kBrowserWindowNotAllowed if the weak pointer is null or IsDeleteScheduled() is true. As a hardening step, it also treats delete-scheduled browsers as unusable when choosing a target browser, both in tabs.create’s browser selection and in the filter helper in browser_window_util.cc.

Key insight
The two handlers used raw BrowserWindowInterface* pointers across Show() calls that can re-enter and destroy the window. The fix re-validates the window through a WeakPtr and IsDeleteScheduled() right after showing it and before any further use.

Attack Path

  1. Extension calls the API An installed extension calls windows.create() or tabs.create(). The tabs.create regression test does this when the only remaining browser is incognito, so the browser has to create a new window.
  2. Window is created and shown The handler creates the new browser window and calls GetWindow()->Show() or ShowInactive() on it.
  3. Window closes during show Under platform-specific conditions the show call leads to the window closing synchronously. The regression tests simulate this with a BrowserCollectionObserver that calls Close() from OnBrowserActivated. How an attacker would reliably cause this on a real platform is not shown (inferred).
  4. Stale pointer is dereferenced Before the patch, the handler kept using new_window or browser (GetProfile(), CreateWindowValueForExtension, OpenTabInBrowser) after the object might already be freed, which is a browser-process use-after-free. Turning that into memory corruption is (inferred).

Impact Assessment

The advisory classifies this as a use-after-free in Extensions in the browser process and gives no exploitation status here. Triggering it needs an extension that calls windows.create/tabs.create, plus a platform or state in which showing the new window destroys it synchronously. The commit message itself calls this “exceptionally rare” and “theoretical”, so reliable triggering by an attacker is not established. Any escalation beyond a browser-process crash, such as code execution, is (inferred).

Changed Functions

FunctionChangeNotes
if
chrome/browser/extensions/api/tabs/tabs_api.cc
modified
CloseOnBrowserCreatedObserver
chrome/browser/extensions/api/tabs/tabs_test.cc
modified
if
chrome/browser/extensions/api/tabs/tabs_test.cc
modified

Files Changed

  • chrome/browser/extensions/api/tabs/tabs_test.cc
  • chrome/browser/extensions/browser_window_util.cc
  • chrome/browser/extensions/api/tabs/tabs_api.cc

Audit Directions

  • Raw window pointers across `Show()`/`Activate()`/`Minimize()`/fullscreen calls
    Search extension APIs and other browser-process callers for a Browser* or BrowserWindowInterface* that is used after a window-state call that may re-enter observers or the platform, and check for WeakPtr re-validation.
  • Observer re-entrancy (`OnBrowserActivated`, `OnBrowserAdded`)
    Any code that creates a browser and then synchronously notifies observers should assume an observer may close it. Audit callers that continue with the new object afterwards.
  • Delete-scheduled objects treated as live
    Look for browser and tab lookups (FindBrowser*, window ID resolution in ExtensionTabUtil) that skip the IsDeleteScheduled() check and can therefore hand closing windows to new operations.
From c999d750660562d1651a2705531a0d6b2359de10 Mon Sep 17 00:00:00 2001
From: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri, 31 Jul 2026 18:07:33 -0700
Subject: [PATCH] [Extensions] Allow for potential window destruction during API calls

windows.create() and tabs.create() allow extensions to create a window
with certain properties, including maximized, minimized, fullscreen,
etc. On very certain platforms in certain condiditions, performing these
operations can theoretically cause the window to destruct.

These occurrences should be exceptionally rare, but can still
theoretically happen. Guard against this by using a WeakPtr to track
browser destruction.

Bug: 537109028
Change-Id: I552eb73ff8f037f9944f8a1f71c122d5c007fd4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8169721
Reviewed-by: Eva Su <evasu@chromium.org>
Commit-Queue: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1672205}
---
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc
index 0041a0c..51689ba 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -1167,6 +1167,7 @@
   if (!new_window) {
     return Error(ExtensionTabUtil::kBrowserWindowNotAllowed);
   }
+
   // NOTE: Even though `new_window` was returned, it may not be fully
   // initialized on non-desktop platforms. See documentation on
   // CreateBrowserWindow().
@@ -1330,8 +1331,14 @@
     focused = *create_data_->focused;
   }
 
+  // Some of the Show() operations below may feasibly cause the window to
+  // destruct. Guard appropriately.
+  base::WeakPtr<BrowserWindowInterface> weak_window = new_window->GetWeakPtr();
+  // Reset `new_window` to prevent it from being used.
+  new_window = nullptr;
+
   if (focused) {
-    new_window->GetWindow()->Show();
+    weak_window->GetWindow()->Show();
   } else {
     // TODO(https://crbug.com/431004500): Port to desktop android.
 #if !BUILDFLAG(IS_ANDROID)
@@ -1344,24 +1351,28 @@
     // the old active browser.
     if (last_active_bwi && last_active_bwi->IsActive()) {
       ScopedPinBrowserAtFront scoper(last_active_bwi);
-      new_window->GetWindow()->ShowInactive();
+      weak_window->GetWindow()->ShowInactive();
     } else {
-      new_window->GetWindow()->ShowInactive();
+      weak_window->GetWindow()->ShowInactive();
     }
 #else
-    new_window->GetWindow()->ShowInactive();
+    weak_window->GetWindow()->ShowInactive();
 #endif  // BUILDFLAG(IS_ANDROID)
   }
 
+  if (!weak_window || weak_window->IsDeleteScheduled()) {
+    return Error(ExtensionTabUtil::kBrowserWindowNotAllowed);
+  }
+
 // Despite creating the window with initial_show_state() ==
 // ui::mojom::WindowShowState::kMinimized above, on Linux the window is not
 // created as minimized.
 // TODO(crbug.com/40254339): Remove this workaround when linux is fixed.
 // TODO(crbug.com/40254339): Find a fix for wayland as well.
 #if BUILDFLAG(IS_LINUX) && BUILDFLAG(SUPPORTS_OZONE_X11)
-  if (BrowserInitState::From(new_window)->initial_show_state() ==
+  if (BrowserInitState::From(weak_window.get())->initial_show_state() ==
       ui::mojom::WindowShowState::kMinimized) {
-    new_window->GetWindow()->Minimize();
+    weak_window->GetWindow()->Minimize();
   }
 #endif  // BUILDFLAG(IS_LINUX) && BUILDFLAG(SUPPORTS_OZONE_X11)
 
@@ -1372,7 +1383,7 @@
   if (create_data_ &&
       create_data_->state == windows::WindowState::kLockedFullscreen) {
 #if BUILDFLAG(IS_CHROMEOS)
-    Browser* const target_browser = new_window->GetBrowserForMigrationOnly();
+    Browser* const target_browser = weak_window->GetBrowserForMigrationOnly();
     if (target_browser) {
       auto* delegate =
           ash::BrowserController::GetInstance()->GetDelegate(target_browser);
@@ -1383,7 +1394,7 @@
 #endif  // BUILDFLAG(IS_CHROMEOS)
   }
 
-  if (new_window->GetProfile()->IsOffTheRecord() &&
+  if (weak_window->GetProfile()->IsOffTheRecord() &&
       !browser_context()->IsOffTheRecord() &&
       !include_incognito_information()) {
     // Don't expose incognito windows if extension itself works in non-incognito
@@ -1392,7 +1403,7 @@
   }
 
   return WithArguments(ExtensionTabUtil::CreateWindowValueForExtension(
-      *new_window, extension(), WindowController::kPopulateTabs,
+      *weak_window, extension(), WindowController::kPopulateTabs,
       source_context_type()));
 }
 
@@ -2151,9 +2162,10 @@
   // browser *and* it's attempting to close? Should that be *or*? This goes
   // back to the dawn of time, AKA the initial implementation in 2014:
   // https://codereview.chromium.org/245933002.
-  if (browser && browser->GetType() != BrowserWindowInterface::TYPE_NORMAL &&
-      UnloadController::From(browser->GetBrowserForMigrationOnly())
-          ->is_attempting_to_close_browser()) {
+  if (browser && (browser->IsDeleteScheduled() ||
+                  (browser->GetType() != BrowserWindowInterface::TYPE_NORMAL &&
+                   UnloadController::From(browser->GetBrowserForMigrationOnly())
+                       ->is_attempting_to_close_browser()))) {
     browser = nullptr;
     fallback_to_tabbed_browser = true;
   }
@@ -2244,7 +2256,18 @@
     return;
   }
 
-  browser->GetWindow()->Show();
+  // The Show() call below could feasibly cause the window to close on some
+  // platforms.
+  base::WeakPtr<BrowserWindowInterface> weak_browser = browser->GetWeakPtr();
+  // Reset `browser` to prevent it from being used.
+  browser = nullptr;
+
+  weak_browser->GetWindow()->Show();
+
+  if (!weak_browser || weak_browser->IsDeleteScheduled()) {
+    Respond(Error(ExtensionTabUtil::kBrowserWindowNotAllowed));
+    return;
+  }
 
   // Re-fetch the opener, if one was specified. This call might fail if the
   // opener tab was destroyed while the window was being created. In that case,
@@ -2257,7 +2280,7 @@
                                  &opener, nullptr);
   }
 
-  OpenTabInBrowser(*browser, opener);
+  OpenTabInBrowser(*weak_browser, opener);
 }
 
 void TabsCreateFunction::OpenTabInBrowser(BrowserWindowInterface& browser,
diff --git a/chrome/browser/extensions/browser_window_util.cc b/chrome/browser/extensions/browser_window_util.cc
index 9c40806a..68a28857 100644
--- a/chrome/browser/extensions/browser_window_util.cc
+++ b/chrome/browser/extensions/browser_window_util.cc
@@ -29,6 +29,11 @@
                           bool include_incognito_or_parent,
                           bool restrict_to_normal_browsers,
                           bool restrict_to_current_workspace) {
+  // The browser's going away, don't use it for anything else.
+  if (browser.IsDeleteScheduled()) {
+    return false;
+  }
+
   if (browser.GetProfile() != &profile) {
     if (!include_incognito_or_parent ||
         !profile.IsSameOrParent(browser.GetProfile())) {
diff --git a/chrome/browser/extensions/api/tabs/tabs_test.cc b/chrome/browser/extensions/api/tabs/tabs_test.cc
index e4c9c9c7..b817967 100644
--- a/chrome/browser/extensions/api/tabs/tabs_test.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_test.cc
@@ -745,6 +745,84 @@
             extension_url);
 }
 
+namespace {
+
+// Simulates the browser immediately closing upon activation. This can
+// potentially happen synchronously as part of showing a window on some
+// platforms, but that's difficult to reproduce in a test directly.
+class CloseOnBrowserCreatedObserver : public BrowserCollectionObserver {
+ public:
+  explicit CloseOnBrowserCreatedObserver(BrowserWindowInterface* ignore_browser)
+      : ignore_browser_(ignore_browser) {
+    observation_.Observe(GlobalBrowserCollection::GetInstance());
+  }
+
+  void OnBrowserActivated(BrowserWindowInterface* browser) override {
+    if (browser != ignore_browser_ && !closed_new_window_) {
+      closed_new_window_ = true;
+      browser->GetWindow()->Close();
+    }
+  }
+
+ private:
+  bool closed_new_window_ = false;
+  raw_ptr<BrowserWindowInterface> ignore_browser_;
+  base::ScopedObservation<GlobalBrowserCollection, BrowserCollectionObserver>
+      observation_{this};
+};
+
+}  // namespace
+
+// Tests that a browser window that's closed as soon as it's shown is
+// gracefully handled (in windows.create). Regression test for
+// https://crbug.com/537109028.
+IN_PROC_BROWSER_TEST_F(ExtensionTabsTest,
+                       WindowsCreateFunctionWindowClosedOnShow) {
+  CloseOnBrowserCreatedObserver observer(browser_window_interface());
+
+  auto function = base::MakeRefCounted<WindowsCreateFunction>();
+  function->SetRenderFrameHost(GetTabListInterface()
+                                   ->GetActiveTab()
+                                   ->GetContents()
+                                   ->GetPrimaryMainFrame());
+  scoped_refptr<const Extension> extension(ExtensionBuilder("Test").Build());
+  function->set_extension(extension.get());
+
+  static const char kArgs[] = R"([{"url": "about:blank"}])";
+  std::string error = api_test_utils::RunFunctionAndReturnError(
+      function.get(), kArgs, profile());
+  EXPECT_EQ(ExtensionTabUtil::kBrowserWindowNotAllowed, error);
+}
+
+// Tests that a browser window that's closed as soon as it's shown is
+// gracefully handled (in tabs.create). Regression test for
+// https://crbug.com/537109028.
+IN_PROC_BROWSER_TEST_F(ExtensionTabsTest,
+                       TabsCreateFunctionWindowClosedOnShow) {
+  Browser* incognito_browser = CreateIncognitoBrowser();
+  CloseBrowserSynchronously(browser());
+
+  auto observer =
+      std::make_unique<CloseOnBrowserCreatedObserver>(incognito_browser);
+
+  scoped_refptr<const Extension> extension(ExtensionBuilder("Test").Build());
+  auto function = base::MakeRefCounted<TabsCreateFunction>();
+  function->SetRenderFrameHost(TabListInterface::From(incognito_browser)
+                                   ->GetActiveTab()
+                                   ->GetContents()
+                                   ->GetPrimaryMainFrame());
+  function->set_extension(extension.get());
+
+  const std::string args = base::StringPrintf(
+      R"([{"url": "%s"}])", extension->GetResourceURL("page.html").spec());
+  std::string error = api_test_utils::RunFunctionAndReturnError(
+      function.get(), args, incognito_browser->GetProfile());
+  EXPECT_EQ(ExtensionTabUtil::kBrowserWindowNotAllowed, error);
+  observer.reset();  // Reset the observer to avoid any dangling pointer issues.
+  // Close the incognito browser to clean up.
+  CloseBrowserSynchronously(incognito_browser);
+}
+
 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest,
                        DefaultToIncognitoWhenItIsForcedAndNoArgs) {
   static const char kEmptyArgs[] = "[]";
Loading diff…

Regression Test / PoC

shipped with the fix
diff --git a/chrome/browser/extensions/api/tabs/tabs_test.cc b/chrome/browser/extensions/api/tabs/tabs_test.cc
index e4c9c9c7..b817967 100644
--- a/chrome/browser/extensions/api/tabs/tabs_test.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_test.cc
@@ -745,6 +745,84 @@
             extension_url);
 }
 
+namespace {
+
+// Simulates the browser immediately closing upon activation. This can
+// potentially happen synchronously as part of showing a window on some
+// platforms, but that's difficult to reproduce in a test directly.
+class CloseOnBrowserCreatedObserver : public BrowserCollectionObserver {
+ public:
+  explicit CloseOnBrowserCreatedObserver(BrowserWindowInterface* ignore_browser)
+      : ignore_browser_(ignore_browser) {
+    observation_.Observe(GlobalBrowserCollection::GetInstance());
+  }
+
+  void OnBrowserActivated(BrowserWindowInterface* browser) override {
+    if (browser != ignore_browser_ && !closed_new_window_) {
+      closed_new_window_ = true;
+      browser->GetWindow()->Close();
+    }
+  }
+
+ private:
+  bool closed_new_window_ = false;
+  raw_ptr<BrowserWindowInterface> ignore_browser_;
+  base::ScopedObservation<GlobalBrowserCollection, BrowserCollectionObserver>
+      observation_{this};
+};
+
+}  // namespace
+
+// Tests that a browser window that's closed as soon as it's shown is
+// gracefully handled (in windows.create). Regression test for
+// https://crbug.com/537109028.
+IN_PROC_BROWSER_TEST_F(ExtensionTabsTest,
+                       WindowsCreateFunctionWindowClosedOnShow) {
+  CloseOnBrowserCreatedObserver observer(browser_window_interface());
+
+  auto function = base::MakeRefCounted<WindowsCreateFunction>();
+  function->SetRenderFrameHost(GetTabListInterface()
+                                   ->GetActiveTab()
+                                   ->GetContents()
+                                   ->GetPrimaryMainFrame());
+  scoped_refptr<const Extension> extension(ExtensionBuilder("Test").Build());
+  function->set_extension(extension.get());
+
+  static const char kArgs[] = R"([{"url": "about:blank"}])";
+  std::string error = api_test_utils::RunFunctionAndReturnError(
+      function.get(), kArgs, profile());
+  EXPECT_EQ(ExtensionTabUtil::kBrowserWindowNotAllowed, error);
+}
+
+// Tests that a browser window that's closed as soon as it's shown is
+// gracefully handled (in tabs.create). Regression test for
+// https://crbug.com/537109028.
+IN_PROC_BROWSER_TEST_F(ExtensionTabsTest,
+                       TabsCreateFunctionWindowClosedOnShow) {
+  Browser* incognito_browser = CreateIncognitoBrowser();
+  CloseBrowserSynchronously(browser());
+
+  auto observer =
+      std::make_unique<CloseOnBrowserCreatedObserver>(incognito_browser);
+
+  scoped_refptr<const Extension> extension(ExtensionBuilder("Test").Build());
+  auto function = base::MakeRefCounted<TabsCreateFunction>();
+  function->SetRenderFrameHost(TabListInterface::From(incognito_browser)
+                                   ->GetActiveTab()
+                                   ->GetContents()
+                                   ->GetPrimaryMainFrame());
+  function->set_extension(extension.get());
+
+  const std::string args = base::StringPrintf(
+      R"([{"url": "%s"}])", extension->GetResourceURL("page.html").spec());
+  std::string error = api_test_utils::RunFunctionAndReturnError(
+      function.get(), args, incognito_browser->GetProfile());
+  EXPECT_EQ(ExtensionTabUtil::kBrowserWindowNotAllowed, error);
+  observer.reset();  // Reset the observer to avoid any dangling pointer issues.
+  // Close the incognito browser to clean up.
+  CloseBrowserSynchronously(incognito_browser);
+}
+
 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest,
                        DefaultToIncognitoWhenItIsForcedAndNoArgs) {
   static const char kEmptyArgs[] = "[]";
Loading diff…

Original Bug Report

reported by vm...@google.com

Potential Use-After-Free in WindowsCreateFunction and TabsCreateFunction after Show()

Project Fortify, an experimental security project, has identified the following potential security issue. If you’re a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: A potential Use-After-Free (UAF) vulnerability exists in the Extensions Tabs API where raw BrowserWindowInterface pointers are dereferenced after showing the window. On Windows, showing a window can synchronously dispatch Win32 window events and trigger the destruction of the underlying browser window. Because the pointer is a bare stack-local parameter, subsequent dereferences result in a UAF in the browser process.

Affected files:

  • chrome/browser/extensions/api/tabs/tabs_api.cc

Estimated timestamp from git blame: 2025-12-12

Potential Root Cause

In chrome/browser/extensions/api/tabs/tabs_api.cc, both WindowsCreateFunction::OnBrowserWindowCreated and TabsCreateFunction::OnBrowserWindowCreated handle browser window creation and receive a raw BrowserWindowInterface* pointer. These functions invoke Show() or ShowInactive() on the window, and subsequently dereference the raw pointer without checking if the window has been synchronously destroyed.

Specifically, calling new_window->GetWindow()->Show() on Windows can lead to HWNDMessageHandler::Show() which, for fullscreen states, executes SetFullscreen(true). This calls ::SetWindowPos or ::ShowWindow, which synchronously dispatches Win32 messages (e.g., WM_WINDOWPOSCHANGED, WM_SIZE, WM_ACTIVATE) into the nested event loop. If the browser window is closed or destroyed during this re-entrant message dispatch, BrowserWidget::OnNativeWidgetDestroyed() is invoked, synchronously running Browser::SynchronouslyDestroyBrowser() and freeing the Browser heap allocation.

Once the native call stack unwinds, control returns to OnBrowserWindowCreated. At this point, the raw pointer (new_window or browser) is dangling:

  • In WindowsCreateFunction::OnBrowserWindowCreated (line 1388), new_window->GetProfile() is invoked, resolving through a virtual method table of the freed object, resulting in a potential Use-After-Free (UAF).
  • In TabsCreateFunction::OnBrowserWindowCreated (line 2259), OpenTabInBrowser(*browser, opener) is called, passing the freed object by reference.

Because these raw pointers are stack-local variables and function arguments rather than class members, they are not protected by MiraclePtr (BackupRefPtr).

Potential Trigger Steps

Note: Since our testing tools do not have the ability to run code, these are potential/suggested steps to reproduce the vulnerability and have not been validated with a running proof of concept.

  1. Install an extension that has access to standard chrome.windows / chrome.tabs APIs (no elevated permissions required).
  2. The extension initiates window creation via chrome.windows.create({state: "fullscreen"}).
  3. During the synchronous window initialization and native display (HWNDMessageHandler::Show -> ::SetWindowPos), a racing listener or hook triggers the synchronous closure of the newly created window.
  4. The window’s synchronous destruction path frees the underlying Browser object on the heap.
  5. Control returns to the calling extension function in tabs_api.cc, which attempts to dereference the now-dangling BrowserWindowInterface* pointer via virtual method calls (such as GetProfile()), leading to a browser-process crash or control-flow hijack.

Suggested Fix

To prevent this vulnerability, capture a base::WeakPtr<BrowserWindowInterface> before calling Show() or ShowInactive(). Verify the validity of the weak pointer immediately after the show call, and return an error or early-exit if the window was destroyed during event dispatching.

For WindowsCreateFunction::OnBrowserWindowCreated:

base::WeakPtr<BrowserWindowInterface> weak_window = new_window->GetWeakPtr();
if (focused) {
  new_window->GetWindow()->Show();
} else {
  new_window->GetWindow()->ShowInactive();
}

if (!weak_window) {
  return Error(ExtensionTabUtil::kBrowserWindowNotAllowed);
}

For TabsCreateFunction::OnBrowserWindowCreated:

base::WeakPtr<BrowserWindowInterface> weak_browser = browser->GetWeakPtr();
browser->GetWindow()->Show();
if (!weak_browser) {
  Respond(Error(ExtensionTabUtil::kBrowserWindowNotAllowed));
  return;
}

Evaluated with Chrome root at commit: bf775e5d75cb9e1767e2cd02cc93efa0077d14a5


Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:

  • If you are familiar with the severity guidelines, you may adjust the severity.
  • If this is a false positive, and there’s no work to be done, please close as WAI.
  • If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.

Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.

View on issue tracker