Chrome · Browser
CVE-2026-17996
Logic Error in Browser
Overview
Low
Severity
—
CVSS
No
Exploited ITW
Fixed
Fix Status
Changed Functions
| Function | Change | Notes |
|---|---|---|
ifchrome/browser/ui/cocoa/BUILD.gn |
modified | |
switchchrome/browser/ui/cocoa/applescript/error_applescript.mm |
modified | |
ifchrome/browser/ui/cocoa/applescript/tab_applescript.mm |
modified |
Files Changed
chrome/app/generated_resources.grdchrome/app/generated_resources_grd/IDS_DEV_TOOLS_NOT_ALLOWED_APPLESCRIPT_MAC.png.sha1chrome/browser/ui/cocoa/BUILD.gnchrome/browser/ui/cocoa/applescript/error_applescript.hchrome/browser/ui/cocoa/applescript/error_applescript.mmchrome/browser/ui/cocoa/applescript/tab_applescript.mm
Patch
From ed1e9faa2ddcd8dbaa82c8beab12b43ff34c67fa Mon Sep 17 00:00:00 2001 From: Avi Drissman <[email protected]> Date: Thu, 18 Jun 2026 21:06:32 -0700 Subject: [PATCH] Gate AppleScript "View Source" on permissions Ensure that doing a View Source requires devtools permissions, even when doing so via AppleScript. Fixed: 521473427 Change-Id: Ib208b06941acf38410df4acc935902516a6a6964 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7959035 Reviewed-by: Bryan Oltman <[email protected]> Commit-Queue: Avi Drissman <[email protected]> Cr-Commit-Position: refs/heads/main@{#1649486} --- diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 425d7a1..d654c5f 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -15582,6 +15582,9 @@ <message name="IDS_JAVASCRIPT_UNSUPPORTED_ERROR_APPLESCRIPT_MAC" desc="Error dialog title to be displayed when the user attempts to execute JavaScript via AppleScript. Mac-only."> Executing JavaScript through AppleScript is turned off. To turn it on, from the menu bar, go to View > Developer > Allow JavaScript from Apple Events. For more information: https://support.google.com/chrome/?p=applescript </message> + <message name="IDS_DEV_TOOLS_NOT_ALLOWED_APPLESCRIPT_MAC" desc="Error dialog title to be displayed when DevTools are not allowed. Mac-only."> + DevTools are not allowed for this URL. + </message> </if> <!-- is_macosx --> diff --git a/chrome/app/generated_resources_grd/IDS_DEV_TOOLS_NOT_ALLOWED_APPLESCRIPT_MAC.png.sha1 b/chrome/app/generated_resources_grd/IDS_DEV_TOOLS_NOT_ALLOWED_APPLESCRIPT_MAC.png.sha1 new file mode 100644 index 0000000..09605cf --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_DEV_TOOLS_NOT_ALLOWED_APPLESCRIPT_MAC.png.sha1 @@ -0,0 +1 @@ +d4b29872ebb32cc09e2b46449da6e0309989e645 \ No newline at end of file diff --git a/chrome/browser/ui/cocoa/BUILD.gn b/chrome/browser/ui/cocoa/BUILD.gn index c7a9f5c..470317a 100644 --- a/chrome/browser/ui/cocoa/BUILD.gn +++ b/chrome/browser/ui/cocoa/BUILD.gn @@ -113,24 +113,9 @@ "window_size_autosaver.mm", ] - deps = [ - "//chrome/browser/ui:recently_audible_helper", - "//chrome/browser/ui:simple_message_box_internal", - ] - - if (enable_updater) { - public += [ "keystone_infobar_delegate.h" ] - sources += [ "keystone_infobar_delegate.cc" ] - deps += [ - "//chrome/browser/infobars", - "//chrome/browser/updater", - "//components/infobars/content", - ] - } - public_deps = [ "//chrome/browser:browser_public_dependencies" ] - deps += [ + deps = [ "//chrome/app:command_ids", "//chrome/app/theme:chrome_unscaled_resources_grit", "//chrome/browser:app_controller_mac", @@ -142,6 +127,7 @@ "//chrome/browser:primitives", "//chrome/browser/apps/platform_apps", "//chrome/browser/bookmarks", + "//chrome/browser/devtools", "//chrome/browser/favicon", "//chrome/browser/feedback:feedback_impl", "//chrome/browser/headless", @@ -151,17 +137,19 @@ "//chrome/browser/notifications", "//chrome/browser/prefs", "//chrome/browser/printing", - "//chrome/browser/profiles", "//chrome/browser/profiles:misc", "//chrome/browser/profiles:profile_manager", "//chrome/browser/profiles:profile_util", + "//chrome/browser/profiles", "//chrome/browser/profiles/keep_alive", "//chrome/browser/search_engines", "//chrome/browser/spellchecker", "//chrome/browser/status_icons", "//chrome/browser/themes", "//chrome/browser/ui:accelerator_utils_headers", + "//chrome/browser/ui:recently_audible_helper", "//chrome/browser/ui:simple_message_box_headers", + "//chrome/browser/ui:simple_message_box_internal", "//chrome/browser/ui:ui_features", "//chrome/browser/ui/autofill", "//chrome/browser/ui/bookmarks", @@ -199,4 +187,14 @@ "//ui/snapshot", "//ui/views", ] + + if (enable_updater) { + public += [ "keystone_infobar_delegate.h" ] + sources += [ "keystone_infobar_delegate.cc" ] + deps += [ + "//chrome/browser/infobars", + "//chrome/browser/updater", + "//components/infobars/content", + ] + } } diff --git a/chrome/browser/ui/cocoa/applescript/error_applescript.h b/chrome/browser/ui/cocoa/applescript/error_applescript.h index 5e2818409..57cdf51 100644 --- a/chrome/browser/ui/cocoa/applescript/error_applescript.h +++ b/chrome/browser/ui/cocoa/applescript/error_applescript.h @@ -31,7 +31,9 @@ // Error when index of browser window is out of bounds. kWrongIndex, // Error when JavaScript execution is disabled. - kJavaScriptUnsupported + kJavaScriptUnsupported, + // Error when DevTools usage is disabled. + kDevToolsUnsupported, }; // This function sets an error message to the currently executing command. diff --git a/chrome/browser/ui/cocoa/applescript/error_applescript.mm b/chrome/browser/ui/cocoa/applescript/error_applescript.mm index fb155ff..0d4ab50 100644 --- a/chrome/browser/ui/cocoa/applescript/error_applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/error_applescript.mm @@ -6,6 +6,8 @@ #import <Foundation/Foundation.h> +#include <utility> + #include "base/notreached.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util_mac.h" @@ -14,7 +16,7 @@ void SetError(Error error_code) { NSScriptCommand* current_command = [NSScriptCommand currentCommand]; - current_command.scriptErrorNumber = static_cast<int>(error_code); + current_command.scriptErrorNumber = std::to_underlying(error_code); NSString* error_string = @""; switch (error_code) { @@ -64,8 +66,10 @@ error_string = l10n_util::GetNSString( IDS_JAVASCRIPT_UNSUPPORTED_ERROR_APPLESCRIPT_MAC); break; - default: - NOTREACHED(); + case Error::kDevToolsUnsupported: + error_string = + l10n_util::GetNSString(IDS_DEV_TOOLS_NOT_ALLOWED_APPLESCRIPT_MAC); + break; } current_command.scriptErrorString = error_string; } diff --git a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm index 9c8a7fea..7389f3cd7 100644 --- a/chrome/browser/ui/cocoa/applescript/tab_applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/tab_applescript.mm @@ -11,6 +11,8 @@ #include "base/memory/weak_ptr.h" #include "base/notreached.h" #include "base/strings/sys_string_conversions.h" +#include "chrome/browser/devtools/devtools_window.h" +#include "chrome/browser/devtools/features.h" #include "chrome/browser/printing/print_view_manager.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/cocoa/applescript/apple_event_util.h" @@ -60,7 +62,9 @@ // make new tab with properties {URL:"http://google.com"} @property(nonatomic, copy) NSString* tempURL; -- (bool)isJavaScriptEnabled; +@property(readonly) Profile* profile; + +@property(readonly, getter=isJavaScriptEnabled) BOOL javaScriptEnabled; @end @@ -77,13 +81,16 @@ @synthesize tempURL = _tempURL; -- (bool)isJavaScriptEnabled { +- (Profile*)profile { + return Profile::FromBrowserContext(_webContents->GetBrowserContext()); +} + +- (BOOL)isJavaScriptEnabled { if (!_webContents) { return false; }
Loading diff…
Original Bug Report
The reporter's bug is still restricted on the tracker. Chrome de-restricts security bugs ~30–90 days after the fix ships; a later run will backfill it here.
References
On This Page