Skip to content
Memory corruption Advisory Advanced CVE-2024-1673

Use after free in Accessibility (CVE-2024-1673)

A use-after-free vulnerability exists in Chrome's accessibility component where a raw pointer to a render frame could be accessed after the frame was deleted, triggered by navigating back and forth. An attacker could potentially exploit this to cause memory corruption, though the report does not demonstrate full exploitation.

Weipeng Jiang Follow

Originally disclosed on Chrome VRP

Bounty$2,000 Medium View original
  • Fix shipped in 41 days

Steps to reproduce the problem:

  1. download asan-linux-release-1245721.zip and unzip
  2. run chrome chrome --user-data-dir=/tmp/noexist123 --no-sandbox and open chrome-untrusted://read-anything-side-panel.top-chrome/
  3. go back and go forward several times to trigger the UAF

Note that this function needs to download a screen_ai library, and it's path is /path/to/user-data/screen_ai/XXXX, if you don't have it, please wait until it is downloaded.

Problem Description:

  1. Analysis

There is a raw_ptr render_frame_[1] in the class AXTreeDistiller, which could be deleted before the ScreenAIServiceReady, causing UAF.

void AXTreeDistiller::ScreenAIServiceReady() {  
  if (main_content_extractor_.is_bound()) {  
    return;  
  }  
  render_frame_->GetBrowserInterfaceBroker()->GetInterface(  
      main_content_extractor_.BindNewPipeAndPassReceiver());  
  main_content_extractor_.set_disconnect_handler(  
      base::BindOnce(&AXTreeDistiller::OnMainContentExtractorDisconnected,  
                     weak_ptr_factory_.GetWeakPtr()));  
}  

[1] https://source.chromium.org/chromium/chromium/src/+/main:chrome/renderer/accessibility/ax_tree_distiller.cc;l=224;drc=ffd37a22a4ccc86280ccdc82e6abc78338060120;bpv=1;bpt=0

  1. Bisect

The use of render_frame_ is introduced in this commit: https://chromium-review.googlesource.com/c/chromium/src/+/3620253 , and it is used in the constructor of AXTreeDistiller. This is introduced in Chrome stable 103.0.5060.53

The render_frame_ is moved to a stand alone function ScreenAIServiceReady in this commit: https://chromium-review.googlesource.com/c/chromium/src/+/4262827, and it in introduced in Chrome stable 112.0.5615.49

  1. Suggested Patch

Maybe you could use a weak_ptr to ensure the lifetime of render_frame_.

Additional Comments:

**Chrome version: ** 110.0.0.0 **Channel: ** Not sure

OS: Linux

The original report as published on the Chromium issue tracker, by Weipeng Jiang (@Krace) of VRI. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

What the attacker needed

Chrome version with accessibility feature; Ability to navigate back and forward; Screen AI library downloaded

The fix

The report suggests using a weak pointer to ensure the lifetime of `render_frame_` is properly managed.

How it was found

  1. Download and unzip the provided ASAN build.
  2. Run Chrome with a fresh user data directory and no sandbox, then open the specified chrome-untrusted URL.
  3. Navigate back and forward several times to trigger the use-after-free.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A use-after-free happens when a program keeps a reference to memory that has already been freed, and later uses it. Here, a pointer to a web page frame was kept after the frame was destroyed, so when a background service became ready, it tried to use the freed frame. This could let an attacker corrupt memory or crash the browser.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by Weipeng Jiang

View all

11 more disclosed reports, best first.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.