{"id":40329,"date":"2023-04-12T21:31:33","date_gmt":"2023-04-12T17:31:33","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/171829\/ZSL-2023-5770.txt"},"modified":"2023-04-16T15:08:25","modified_gmt":"2023-04-16T10:38:25","slug":"google-chrome-browser-111-0-5563-64-axplatformnodecocoa-denial-of-service","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/google-chrome-browser-111-0-5563-64-axplatformnodecocoa-denial-of-service\/","title":{"rendered":"Google Chrome Browser 111.0.5563.64 AXPlatformNodeCocoa Denial Of Service"},"content":{"rendered":"<p>Google Chrome Browser 111.0.5563.64 AXPlatformNodeCocoa Fatal OOM\/Crash (macOS)<\/p>\n<p>Vendor: Google LLC<br \/>\nProduct web page: https:\/\/www.google.com<br \/>\nAffected version: 111.0.5563.64 (Official Build) (x86_64)<br \/>\n110.0.5481.100 (Official Build) (x86_64)<br \/>\n108.0.5359.124 (Official Build) (x86_64)<br \/>\n108.0.5359.98 (Official Build) (x86_64)<br \/>\nFixed version: 112.0.5615.49 (Official Build) (x86_64)<\/p>\n<p>Summary: Google Chrome browser is a free web browser used for<br \/>\naccessing the internet and running web-based applications. The<br \/>\nGoogle Chrome browser is based on the open source Chromium web<br \/>\nbrowser project. Google released Chrome in 2008 and issues several<br \/>\nupdates a year.<\/p>\n<p>Desc: Fatal OOM\/crash of Chrome browser while detaching\/attaching<br \/>\ntabs on macOS.<\/p>\n<p>Commit fix:<\/p>\n<p>&#8220;The original cl landed many months ago, but<br \/>\nchrome\/browser\/ui\/views\/frame\/browser_non_client_frame_view_mac.mm<br \/>\nis the only change that didn&#8217;t revert cleanly.&#8221;<\/p>\n<p>macOS a11y: Implement accessibilityHitTest for remote app shims (PWAs)<\/p>\n<p>Implements accessibility hit testing for RemoteCocoa so that Hover Text<br \/>\nand VoiceOver mouse mode can read the accessible objects under the<br \/>\nuser&#8217;s pointer. Cross-process plumbing was needed because RemoteCocoa<br \/>\nbridges to native controls in a separate app shim process and must<br \/>\nreport accessibility trees from the browser process via the<br \/>\nundocumented NSAccessibilityRemoteUIElement mechanism.<\/p>\n<p>This CL does the following:<\/p>\n<p>1. Unblocks remote accessibilityHitTest by calling setRemoteUIApp:YES<br \/>\nin the browser process. This enables the browser process to accept<br \/>\nredirected accessibilityHitTest calls to the object corresponding to<br \/>\nany NSAccessibilityRemoteUIElement returned by the original<br \/>\naccessibilityHitTest at the app shim process.<\/p>\n<p>2. (For Browser UI) Overrides NativeWidgetMacNSWindowTitledFrame&#8217;s<br \/>\naccessibilityHitTest to have a custom implementation with<br \/>\nNSAccessibilityRemoteUIElement support so that custom window<br \/>\ncontrols can be found. Additionally, adjusts the BrowserView bounds<br \/>\nso that AXPlatformNodeCocoa&#8217;s accessibilityHitTest (which doesn&#8217;t<br \/>\nsupport view targeting) can return controls in the web app frame<br \/>\ntoolbar.<\/p>\n<p>3. (For Web Content) Implements RenderWidgetHostViewCocoa&#8217;s<br \/>\naccessibilityHitTest for instances in the app shim to return a<br \/>\nNSAccessibilityRemoteUIElement corresponding to their counterparts<br \/>\nin the browser process so that web content objects can be found.<\/p>\n<p>Tested on: macOS 12.6.1 (Monterey)<br \/>\nmacOS 13.3.1 (Ventura)<\/p>\n<p>Vulnerability discovered by Gjoko &#8216;LiquidWorm&#8217; Krstic<br \/>\n@zeroscience<\/p>\n<p>Advisory ID: ZSL-2023-5770<br \/>\nAdvisory URL: https:\/\/www.zeroscience.mk\/en\/vulnerabilities\/ZSL-2023-5770.php<\/p>\n<p>08.12.2022<\/p>\n<p>&#8212;<\/p>\n<p>UI PoC:<br \/>\n&#8212;&#8212;-<br \/>\n1. Grab a tab and detach it.<br \/>\n2. Bring back the tab.<br \/>\n3. Do this 2-3 times attaching \/ re-attaching the tab.<br \/>\n4. Chrome will hang (100% CPU) \/ Out-of-Memory (OOM) for 7-8 minutes.<br \/>\n5. Process crashes entirely.<\/p>\n<p>Ref: Issue 1400682 (Ticket created: Dec 13, 2022)<br \/>\nRef: https:\/\/bugs.chromium.org\/p\/chromium\/issues\/detail?id=1400682<br \/>\nRef: https:\/\/chromium-review.googlesource.com\/c\/chromium\/src\/+\/3861171<br \/>\nRef: axtester.mm terminal PoC by xi.ch&#8230;@gmail.com (https:\/\/bugs.chromium.org\/u\/161486905)<\/p>\n<p>=============<br \/>\n\/\/<br \/>\n\/\/ Copyright (c) Microsoft Corporation. All rights reserved.<br \/>\n\/\/<\/p>\n<p>#include &lt;ApplicationServices\/ApplicationServices.h&gt;<\/p>\n<p>#include &lt;iostream&gt;<br \/>\n#include &lt;sstream&gt;<br \/>\n#include &lt;vector&gt;<\/p>\n<p>__BEGIN_DECLS<br \/>\n\/\/ NOLINTNEXTLINE<br \/>\nAXError _AXUIElementGetWindow(AXUIElementRef, CGWindowID *);<br \/>\n\/\/ NOLINTNEXTLINE<br \/>\nCFTypeID AXTextMarkerGetTypeID();<br \/>\n__END_DECLS<\/p>\n<p>std::ostream&amp; bold_on(std::ostream&amp; os)<br \/>\n{<br \/>\nif (isatty(STDOUT_FILENO))<br \/>\n{<br \/>\nreturn os &lt;&lt; &#8220;\\e[1m&#8221;;<br \/>\n}<br \/>\nreturn os;<br \/>\n}<\/p>\n<p>std::ostream&amp; bold_off(std::ostream&amp; os)<br \/>\n{<br \/>\nif (isatty(STDOUT_FILENO))<br \/>\n{<br \/>\nreturn os &lt;&lt; &#8220;\\e[0m&#8221;;<br \/>\n}<br \/>\nreturn os;<br \/>\n}<\/p>\n<p>std::string from_cfstr(CFTypeRef cf_ref)<br \/>\n{<br \/>\nif (cf_ref != nullptr &amp;&amp; CFGetTypeID(cf_ref) == CFStringGetTypeID())<br \/>\n{<br \/>\nconst auto cf_str = static_cast&lt;CFStringRef&gt;(cf_ref);<br \/>\nconst auto max_length = static_cast&lt;size_t&gt;(CFStringGetMaximumSizeForEncoding(<br \/>\nCFStringGetLength(cf_str), kCFStringEncodingUTF8)) + 1;<\/p>\n<p>auto result = std::string(max_length, &#8216;\\0&#8217;);<br \/>\nif (CFStringGetCString(cf_str, result.data(), static_cast&lt;CFIndex&gt;(max_length), kCFStringEncodingUTF8))<br \/>\n{<br \/>\nif (const auto pos = result.find(&#8216;\\0&#8217;); pos != std::string::npos)<br \/>\n{<br \/>\nresult.resize(pos);<br \/>\n}<br \/>\nreturn result;<br \/>\n}<br \/>\n}<br \/>\nreturn {};<br \/>\n}<\/p>\n<p>std::string ax_element_id(AXUIElementRef value)<br \/>\n{<br \/>\n\/\/ AX element cache &#8211; AX elements are backed by CFData<br \/>\n\/\/ (referring to &#8216;remote&#8217; AX objects) and this data is<br \/>\n\/\/ &#8216;stable&#8217; across &#8216;volatile&#8217; instances of AXUIElement.<br \/>\n\/\/ &#8216;hash and equality&#8217; of AX elements are based on this<br \/>\n\/\/ data and therefore, we can use AXUIElement objects as<br \/>\n\/\/ &#8216;keys&#8217; in a dictionary with values, identifying these<br \/>\n\/\/ objects (uniquely).<br \/>\nconst static auto ax_elements = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,<br \/>\n&amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks);<\/p>\n<p>auto ax_id = CFDictionaryGetValue(ax_elements, value);<\/p>\n<p>if (ax_id == nullptr)<br \/>\n{<br \/>\nif (const auto uuid = CFUUIDCreate(kCFAllocatorDefault))<br \/>\n{<br \/>\nif (const auto uuid_s = CFUUIDCreateString(kCFAllocatorDefault, uuid))<br \/>\n{<br \/>\nCFDictionarySetValue(ax_elements, value, uuid_s);<\/p>\n<p>CFRelease(uuid_s);<br \/>\n}<br \/>\nCFRelease(uuid);<br \/>\n}<\/p>\n<p>ax_id = CFDictionaryGetValue(ax_elements, value);<br \/>\n}<\/p>\n<p>return from_cfstr(ax_id);<br \/>\n}<\/p>\n<p>template &lt;typename T&gt;<br \/>\nT ax_attribute_value(AXUIElementRef e, CFStringRef name)<br \/>\n{<br \/>\nif (e != nullptr)<br \/>\n{<br \/>\nauto ref = T{};<br \/>\nif (AXUIElementCopyAttributeValue(e, name, (CFTypeRef *) &amp;ref) == kAXErrorSuccess)<br \/>\n{<br \/>\nreturn ref;<br \/>\n}<br \/>\n}<br \/>\nreturn nullptr;<br \/>\n}<\/p>\n<p>\/\/ NOLINTNEXTLINE<br \/>\nvoid ax_traverse(AXUIElementRef elem, uint32_t depth)<br \/>\n{<br \/>\nconst auto max_depth = 10;<br \/>\nif (depth &gt; max_depth)<br \/>\n{<br \/>\nreturn;<br \/>\n}<\/p>\n<p>const auto indent = [&amp;]()<br \/>\n{<br \/>\nfor (auto x = 0; x &lt; depth; x++)<br \/>\n{<br \/>\nstd::cout &lt;&lt; &#8221; &#8220;;<br \/>\n}<br \/>\n};<\/p>\n<p>auto wid = CGWindowID{};<br \/>\nif (_AXUIElementGetWindow(elem, &amp;wid) != kAXErrorSuccess)<br \/>\n{<br \/>\nwid = 0;<br \/>\n}<\/p>\n<p>indent();<br \/>\nconst auto role = ax_attribute_value&lt;CFTypeRef&gt;(elem, kAXRoleAttribute);<\/p>\n<p>std::cout &lt;&lt; bold_on &lt;&lt; &#8220;[*** DEPTH: &#8221; &lt;&lt; depth &lt;&lt; &#8220;, ROLE: &#8221; &lt;&lt; from_cfstr(role) &lt;&lt;<br \/>\n&#8220;, ID: &#8221; &lt;&lt; ax_element_id(elem) &lt;&lt; &#8220;, WINDOW: &#8221; &lt;&lt; wid &lt;&lt; &#8221; ***]&#8221; &lt;&lt; bold_off &lt;&lt;<br \/>\nstd::endl;<\/p>\n<p>if (const auto children = ax_attribute_value&lt;CFArrayRef&gt;(elem, kAXChildrenAttribute))<br \/>\n{<br \/>\nfor (CFIndex idx = 0; idx &lt; CFArrayGetCount(children); idx++)<br \/>\n{<br \/>\nconst auto element = static_cast&lt;AXUIElementRef&gt;(CFArrayGetValueAtIndex(children, idx));<br \/>\nax_traverse(element, depth + 1);<br \/>\n}<br \/>\nCFRelease(children);<br \/>\n}<br \/>\n}<\/p>\n<p>int main(int argc, char* const argv[])<br \/>\n{<br \/>\nauto pid = 0;<\/p>\n<p>if (argc &gt; 1)<br \/>\n{<br \/>\nif (!AXIsProcessTrusted())<br \/>\n{<br \/>\nstd::cerr &lt;&lt; &#8220;Please &#8216;AX approve&#8217; Terminal in System Preferences&#8221; &lt;&lt; std::endl;<br \/>\nexit(1); \/\/ NOLINT<br \/>\n}<br \/>\n\/\/ NOLINTNEXTLINE<br \/>\npid = std::stoi(argv[1]);<br \/>\n}<br \/>\nelse<br \/>\n{<br \/>\nstd::cerr &lt;&lt; &#8220;usage: axtester &lt;pid&gt;&#8221; &lt;&lt; std::endl;<br \/>\nexit(1); \/\/ NOLINT<br \/>\n}<\/p>\n<p>if (const auto app = AXUIElementCreateApplication(pid))<br \/>\n{<br \/>\nauto observer = AXObserverRef{};<br \/>\nauto ret = AXObserverCreate(pid, [](auto \/*unused*\/, AXUIElementRef \/*unused*\/, CFStringRef name, auto ctx)<br \/>\n{<br \/>\nauto myapp = (__AXUIElement*)(ctx);<br \/>\nauto hint = CFStringGetCStringPtr(name,kCFStringEncodingUTF8);<br \/>\nstd::cout &lt;&lt; &#8220;Hint: &#8221; &lt;&lt; hint &lt;&lt; std::endl;<br \/>\nax_traverse(myapp, 0);<br \/>\n}, &amp;observer);<\/p>\n<p>if (kAXErrorSuccess != ret)<br \/>\n{<br \/>\nstd::cerr &lt;&lt; &#8220;Fail to create observer&#8221; &lt;&lt; std::endl;<br \/>\nreturn -1;<br \/>\n}<\/p>\n<p>std::cout &lt;&lt; &#8220;title:&#8221; &lt;&lt; AXObserverAddNotification(observer, app, kAXTitleChangedNotification, (void*)app) &lt;&lt; std::endl;<br \/>\nstd::cout &lt;&lt; &#8220;focus_window:&#8221; &lt;&lt; AXObserverAddNotification(observer, app, kAXFocusedWindowChangedNotification, (void*)app) &lt;&lt; std::endl;<br \/>\nstd::cout &lt;&lt; &#8220;focus_element:&#8221; &lt;&lt; AXObserverAddNotification(observer, app, kAXFocusedUIElementChangedNotification, (void*)app) &lt;&lt; std::endl;<br \/>\nstd::cout &lt;&lt; &#8220;move:&#8221; &lt;&lt; AXObserverAddNotification(observer, app, kAXWindowMovedNotification, (void*)app) &lt;&lt; std::endl;<br \/>\nstd::cout &lt;&lt; &#8220;resize:&#8221; &lt;&lt; AXObserverAddNotification(observer, app, kAXWindowResizedNotification, (void*)app) &lt;&lt; std::endl;<br \/>\nstd::cout &lt;&lt; &#8220;deminiaturized:&#8221; &lt;&lt; AXObserverAddNotification(observer, app, kAXWindowDeminiaturizedNotification, (void*)app) &lt;&lt; std::endl;<br \/>\nstd::cout &lt;&lt; &#8220;miniaturize:&#8221; &lt;&lt; AXObserverAddNotification(observer, app, kAXWindowMiniaturizedNotification, (void*)app) &lt;&lt; std::endl;<br \/>\nCFRunLoopAddSource(CFRunLoopGetCurrent(), AXObserverGetRunLoopSource(observer), kCFRunLoopDefaultMode);<br \/>\nCFRunLoopRun();<br \/>\n}<\/p>\n<p>return 0;<br \/>\n}<\/p>\n<p>&#8211;codeaibot explains&#8211;<\/p>\n<p>This is a C++ program that uses the Accessibility API (AX) provided<br \/>\nby macOS to traverse the user interface of a running application and<br \/>\nprint out information about the accessibility elements that it finds.<\/p>\n<p>The program takes a single argument, which is the process ID (PID) of<br \/>\nthe application to examine. If no argument is provided, the program<br \/>\ndisplays a usage message and exits.<\/p>\n<p>The main() function first checks if the Terminal app has been granted<br \/>\naccessibility privileges by calling the AXIsProcessTrusted() function.<br \/>\nIf it hasn&#8217;t, the program displays an error message and exits.<\/p>\n<p>If the Terminal app has been granted accessibility privileges, the program<br \/>\ncreates an AXUIElementRef object for the application using the AXUIElementCreateApplication()<br \/>\nfunction, passing in the PID as an argument.<\/p>\n<p>The ax_traverse() function is then called with the root accessibility<br \/>\nelement of the application as an argument. This function recursively<br \/>\ntraverses the accessibility tree of the application, printing out<br \/>\ninformation about each element it encounters.<\/p>\n<p>The program also defines several helper functions for working with Core<br \/>\nFoundation types (from_cfstr(), ax_element_id(), and ax_attribute_value()),<br \/>\nas well as some functions for printing formatted output to the console<br \/>\n(bold_on() and bold_off()).<\/p>\n<p>&#8212; \/ &#8212;<\/p>\n<p>As this issue is not a security issue nor results in security consequences,<br \/>\nthis report is not eligible for a VRP reward.<\/p>\n<p>++<br \/>\nThank you Amy!<br \/>\n&#8212;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google Chrome Browser 111.0.5563.64 AXPlatformNodeCocoa Fatal OOM\/Crash (macOS) Vendor: Google LLC Product web page: https:\/\/www.google.com Affected version: 111.0.5563.64 (Official Build) (x86_64) 110.0.5481.100 (Official Build) (x86_64) 108.0.5359.124 (Official Build) (x86_64) 108.0.5359.98 (Official Build) (x86_64) Fixed version: 112.0.5615.49 (Official Build) (x86_64) Summary: Google Chrome browser is a free web browser used for accessing the internet and running &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-40329","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/40329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=40329"}],"version-history":[{"count":1,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/40329\/revisions"}],"predecessor-version":[{"id":40410,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/40329\/revisions\/40410"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=40329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=40329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=40329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}