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

Use after free in Browser UI (CVE-2024-5842)

A use-after-free vulnerability in Chrome's browser UI occurs when a profile is deleted while a tab is being dragged, leading to a crash. An attacker could potentially exploit this to execute arbitrary code, though the report only demonstrates a crash.

Sven Dysthe Follow

Originally disclosed on Chrome VRP

Bounty$1,000 Medium View original
  • Fix shipped in 17 months

Steps to reproduce the problem:
I may create a patch in the future that doesn't require the manual steps below.

Manual Steps:

  1. Create a new profile.
  2. In your "User Data" folder for Chrome, find the name of the new profile created e.g. "Profile 34" or "Profile 5".
  3. Once found, open the new profile.
  4. Visit chrome://profile-picker and open devtools console.
  5. Execute:
    setTimeout(()=>{
    chrome.send("removeProfile", ["C:\Path\To\The\Profile Name from Step 3"]);
    console.log("Profile is deleted, create a new tab in deleted profile and close it.");
    },15000)
  6. Focus new profile, create new tab and drag tab out. Hold tab with mouse, do not let go!
  7. Wait for step 5 to execute then create a new tab.
  8. Close the new tab. UAF triggers.

Problem Description:
I see a few checks being hit as well:

[27396:22964:0112/155149.469:ERROR:profile_attributes_storage.cc(420)] Check failed: false.
[27396:22964:0112/155347.212:ERROR:profile_attributes_storage.cc(420)] Check failed: false.
[27396:22964:0112/155347.212:ERROR:profile_manager.cc(662)] Loading a profile path that does not exist
[27396:22964:0112/155448.853:ERROR:browser_tabstrip.cc(95)] Check failed: false. CloseWebContents called for tab not in our strip

Additional Comments:
Not protected by Miracle Pointer.

**Chrome version: ** 108.0.0.0 **Channel: ** Not sure

OS: Windows

The original report as published on the Chromium issue tracker, by Sven Dysthe (@svn_dy). 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

Root cause

Likely, the browser UI does not properly handle the deletion of a profile while a tab drag operation is in progress, leading to a use-after-free.

Impact

The vulnerability causes a crash (use-after-free) and could potentially lead to arbitrary code execution, though the report only demonstrates a crash.

What the attacker needed

Chrome version 108 on Windows; Ability to run JavaScript in chrome://profile-picker

How it was found

  1. Create a new profile.
  2. Find the profile folder name in the User Data directory.
  3. Open the new profile.
  4. Go to chrome://profile-picker and open the developer console.
  5. Run a script that deletes the profile after a delay.
  6. Drag a tab out and hold it, then create and close a new tab 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 is a bug where a program keeps using memory after it has been freed, which can lead to crashes or, worse, let an attacker run their own code. Here, deleting a profile while dragging a tab causes the browser to use freed memory, resulting in a crash.

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 Sven Dysthe

View all

1 more disclosed report, 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.