Use after free in Family Experiences (CVE-2024-10826)
A use-after-free vulnerability exists in the SupervisedUserGoogleAuthNavigationThrottle on Android when an unauthenticated supervised user accesses Google-owned sites. If the native view is unavailable, a synchronous failure callback cancels navigation and deletes the throttle object, leading to use-after-free when the code continues to access member variables.
- Fix shipped in 38 days
VULNERABILITY DETAILS
On Android platform, when an unauthenticated supervised user tries to access some Google-owned sites, the SupervisedUserGoogleAuthNavigationThrottle would start a reauthentication process, as shown in the following call sequence:
SupervisedUserGoogleAuthNavigationThrottle::WillStartOrRedirectRequest
-> SupervisedUserGoogleAuthNavigationThrottle::ShouldProceed
-> ReauthenticateChildAccount
ReauthenticateChildAccount may run the on_failure_callback synchronously if the native view is not available [1]. The on_failure_callback is SupervisedUserGoogleAuthNavigationThrottle::OnReauthenticationFailed, and it will cancel the navigation which deletes the current running throttle object [2]. After ShouldProceed returns, the code would continue access some member variables which results in UAF [3].
Note that the UAF would be triggered only if on_failure_callback is invoked synchronously, as the code comment indicates, it may only happen on tab or browser shutdown. I did not find a way to stably destroy the view while keeping the throttle running (although it might exist), so feel free to downgrade the severity.
void ReauthenticateChildAccount(
content::WebContents* web_contents,
const std::string& email,
const base::RepeatingCallback<void()>& on_failure_callback) {
ui::WindowAndroid* window_android =
web_contents->GetNativeView()->GetWindowAndroid();
if (!window_android) {
// The native view may not be available on shutdown (crbug.com/1468955).
on_failure_callback.Run(); // ===> [1]
return;
}
...
}
void SupervisedUserGoogleAuthNavigationThrottle::OnReauthenticationFailed() {
// Cancel the navigation if reauthentication failed.
CancelDeferredNavigation(content::NavigationThrottle::CANCEL_AND_IGNORE); // ===> [2]
}
content::NavigationThrottle::ThrottleCheckResult
SupervisedUserGoogleAuthNavigationThrottle::WillStartOrRedirectRequest() {
// ...
content::NavigationThrottle::ThrottleCheckResult result = ShouldProceed();
if (result.action() == content::NavigationThrottle::DEFER) {
google_auth_state_subscription_ =
child_account_service_->ObserveGoogleAuthState( // ===> [3]
base::BindRepeating(&SupervisedUserGoogleAuthNavigationThrottle::
OnGoogleAuthStateChanged,
base::Unretained(this)));
}
return result;
}
VERSION
Chrome Version: stable + dev
Operating System: Android
REPRODUCTION CASE
-
Apply the attached patch.diff, this is to simulate an signed-in unauthenticated supervised user to Chromium
-
Run webserver using nodejs
node server.js
adb reverse tcp:8000 tcp:8000
-
Launch asan build chromium on Android
out/Default/bin/chrome_public_apk run
and navigate to http://localhost:8000/poc.html
FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION
Type of crash: browser
Crash State: see asan.log for details
Bisection
This was introduced in https://chromium.googlesource.com/chromium/src/+/b40c9c2acdd4b858053ee4d8988daeb412db4d04
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 on_failure_callback is invoked synchronously, which cancels the navigation and deletes the throttle object, but the calling code continues to access member variables of the deleted object.
Impact
The use-after-free could crash the browser, but the reporter notes it may only happen on tab or browser shutdown and did not find a stable way to trigger it, so severity may be lower.
What the attacker needed
Android platform; unauthenticated supervised user; native view unavailable (e.g., shutdown)
How it was found
- Apply the attached patch.diff to simulate a signed-in unauthenticated supervised user in Chromium.
- Run a webserver using nodejs and set up adb reverse port forwarding.
- Launch an ASAN build of Chromium on Android and navigate to the proof-of-concept page.
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 frees memory but then keeps using it, like deleting a file and then trying to open it. Here, a navigation helper object is deleted during a failure callback, but the code still tries to use it afterwards, which can crash the browser or potentially allow an attacker to run code. The bug only triggers in a specific situation, such as when the browser is shutting down.
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.