Use after free in Updater (CVE-2026-17716)
A use-after-free exists in the macOS updater because a heap-allocated response code is freed by a completion callback while a repeating callback still holds a raw pointer to it. A compromised unprivileged net-worker child process could send out-of-order Mojo messages to write a 32-bit value into freed memory in the root updater process, potentially escalating privileges.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 51 days
Flapjack, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A Use-After-Free vulnerability exists in the macOS updater process due to unsafe lifetime management of a heap-allocated response code variable passed between Mojo callbacks. A compromised, unprivileged net-worker child process can trigger this UAF in the high-privileged root updater process by sending out-of-order Mojo messages. Crucially, the updater executable does not initialize PartitionAlloc security features, bypassing MiraclePtr protections.
Affected files:
chrome/updater/event_logger.ccchrome/updater/net/network_fetcher_mac.mm
Estimated timestamp from git blame: 2025-06-09
Summary
A potential Use-After-Free (UAF) vulnerability exists in the Google Update (updater) process due to incorrect lifetime management of response code variables passed to network callbacks. An attacker who has compromised the unprivileged net-worker child process can exploit this to achieve a 32-bit arbitrary heap write in the high-privileged (root) updater process on macOS, leading to Local Privilege Escalation (LPE).
Vulnerability Details
In chrome/updater/event_logger.cc, the RemoteLoggingDelegate::DoPostRequest function initiates network requests and manages the HTTP response code using a heap-allocated std::optional<int> wrapped in a std::unique_ptr (line 153).
The raw pointer response_code_ptr is bound to a RepeatingCallback (ResponseStartedCallback), while the unique_ptr itself is moved into a OnceCallback (PostRequestCompleteCallback).
// ResponseStartedCallback
base::BindRepeating(
[](std::optional<int>* response_code_out, int response_code,
int64_t content_length) {
*response_code_out = response_code;
},
response_code_ptr),
// PostRequestCompleteCallback
base::BindOnce(
[](...,
std::unique_ptr<std::optional<int>> response_code,
...) { ... },
..., std::move(response_code), ...));
These callbacks are passed over Mojo to the unprivileged --net-worker child process via a mojo::SelfOwnedReceiver<mojom::PostRequestObserver> named PostRequestObserverImpl (chrome/updater/net/fetcher_callback_adapter.cc).
A compromised net-worker process can exploit this through the following steps:
- The attacker sends an
OnRequestCompleteMojo message to the root updater process. PostRequestObserverImpl::OnRequestCompleteexecutes the completionOnceCallback. When the callback finishes, theunique_ptrgoes out of scope, freeing the heap memory backing the response code.- Because
PostRequestObserverImplis managed by aSelfOwnedReceiver, it remains alive as long as the Mojo pipe is open. The attacker does not close the pipe. - The attacker sends an
OnResponseStarted(uint32 http_status_code, ...)Mojo message, supplying a malicious 32-bit payload as the status code. PostRequestObserverImpl::OnResponseStartedis called, which executes theRepeatingCallback.- The callback dereferences the now-dangling
response_code_ptr, resulting in an arbitrary 32-bit write (*response_code_out = response_code;) into freed memory.
A similar vulnerable pattern exists in chrome/updater/net/network_fetcher_mac.mm within the WrapDownloadToFileCallbacksWithEventLogging function (line 475), where a std::unique_ptr<int> is used in the same manner.
Impact and MiraclePtr Bypass
Because the main updater process runs as root on macOS, this vulnerability allows for Local Privilege Escalation (LPE) to root.
Notably, Chromium's MiraclePtr (BackupRefPtr) mitigation does not protect against this issue. While base::Bind wraps raw pointers in UnretainedWrapper, the standalone updater executable (chrome/updater/updater.cc) does not initialize PartitionAllocSupport (e.g., via ReconfigureEarlyish or ReconfigureAfterFeatureListInit). Because PartitionAlloc security features are not initialized, the freed memory is not quarantined, and the UAF is fully exploitable.
(Note: These are potential steps based on static analysis; we do not yet have a working proof of concept that has been successfully run against the compiled binary).
Recommendation
Use scoped_refptr<base::RefCountedData<int>> (or a similar ref-counted wrapper) to manage the lifetime of the response code variable across multiple callbacks, ensuring that the object remains valid as long as any callback holds a reference to it. This safe pattern is already correctly employed in WrapPostRequestCallbacksWithEventLogging in chrome/updater/net/network_fetcher_mac.mm. Furthermore, the updater process should explicitly initialize PartitionAlloc security features to benefit from MiraclePtr.
Evaluated with Chrome root at commit: 2155cb00003ec35716a76ed3246eae995f87b7ff
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
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 response code is owned by a unique_ptr moved into a one-shot completion callback while a repeating callback keeps a raw pointer to the same object, so the object is freed while still referenced.
Impact
Because the updater runs as root on macOS, this could allow local privilege escalation, and the text notes MiraclePtr does not help because PartitionAlloc security features are not initialised in the updater; the authors state they have no working proof of concept yet.
What the attacker needed
Compromise of the unprivileged net-worker process; macOS updater running as root
The fix
The response code should be managed with a reference-counted wrapper so it stays alive while any callback holds it, and the updater should initialise PartitionAlloc security features.
How it was found
- Send an OnRequestComplete message to the root updater process.
- The completion callback runs and the unique_ptr frees the response code memory.
- Keep the Mojo pipe open so the self-owned receiver stays alive.
- Send an OnResponseStarted message with a chosen status code value.
- The repeating callback runs and writes the status code into the freed memory.
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.
The updater keeps a small piece of memory holding an HTTP status code and hands a pointer to it to two callbacks. One callback frees that memory when the request finishes, but the other callback still points at it and can write into it later. If an attacker controls the helper process that talks to the updater, they can make that write happen after the free, corrupting memory in a program that runs with full system rights.
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.