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.
Originally disclosed on Chrome VRP
- 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:
- Create a new profile.
- In your "User Data" folder for Chrome, find the name of the new profile created e.g. "Profile 34" or "Profile 5".
- Once found, open the new profile.
- Visit chrome://profile-picker and open devtools console.
- 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) - Focus new profile, create new tab and drag tab out. Hold tab with mouse, do not let go!
- Wait for step 5 to execute then create a new tab.
- 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
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
- Create a new profile.
- Find the profile folder name in the User Data directory.
- Open the new profile.
- Go to chrome://profile-picker and open the developer console.
- Run a script that deletes the profile after a delay.
- 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.