Use after free in Proxy (CVE-2026-84324)
A re-entrancy ordering flaw in Chrome's proxy resolution code means a completing request can be re-dispatched and freed while still on the stack, leaving the outer frame to read and write through a dangling pointer. A local network attacker could force the synchronous failure path via DNS manipulation and a PAC resolver crash, potentially gaining a write primitive in the unsandboxed network service.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 54 days
Project Fortify, 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 re-entrancy flaw in ConfiguredProxyResolutionRequest::QueryComplete can lead to a potential Use-After-Free in the unsandboxed network service. If a PAC script terminates and proxy initialization fails synchronously due to a negative DNS cache hit, the completing request is re-dispatched, freed nestedly, and then accessed upon stack unwind. An attacker can deterministically trigger the required synchronous failure via DNS manipulation and the PacFileDeciderPoller.
Affected files:
net/proxy_resolution/configured_proxy_resolution_request.ccnet/proxy_resolution/configured_proxy_resolution_service.ccnet/http/http_stream_factory_job_controller.cc
Estimated timestamp from git blame: Unknown (Google3 checkout)
1. Summary of the Issue (Meant for Human Triage)
A potential Use-After-Free (UAF) vulnerability exists in Google Chrome's proxy resolution architecture, specifically within ConfiguredProxyResolutionRequest::QueryComplete. The flaw occurs because a completing request invokes the proxy resolution service (DidFinishResolvingProxy) before removing itself from the list of pending requests (pending_requests_).
If the PAC script terminates unexpectedly (e.g., due to a crash), the service attempts to reset and re-initialize the proxy configuration. If this re-initialization fails synchronously, the service immediately calls SetReady(). Because the completing request is still in pending_requests_ and has had its state marked as not started, SetReady() synchronously re-dispatches it. This results in a nested execution of QueryComplete that executes the consumer callback and frees the request object. As the execution stack unwinds to the outer QueryDidComplete frame, it accesses members of the now-freed request object, leading to a UAF.
While proxy initialization is typically asynchronous, a local network attacker (A-NETCONF) can force a synchronous failure on Linux, Mac, or Android. By manipulating DNS to return NXDOMAIN for the wpad host, the attacker causes the background PacFileDeciderPoller to populate the HostCache with a negative entry keyed to the service's persistent transient NetworkAnonymizationKey. If the attacker then crashes the PAC resolver, the resulting Mojo disconnect (processed as a high-priority I/O event) triggers the re-entrancy flaw. The re-initialization hits the primed negative DNS cache synchronously, satisfying all conditions for the UAF. As the Network Service is unsandboxed on Linux, Mac, ChromeOS, and Android, this UAF can potentially be exploited for remote code execution.
2. Proof-of-Concept & Detailed Execution Flow
Root Cause Analysis
The ordering flaw resides in ConfiguredProxyResolutionRequest::QueryComplete:
// net/proxy_resolution/configured_proxy_resolution_request.cc:218-227
void ConfiguredProxyResolutionRequest::QueryComplete(int result_code) {
result_code = QueryDidComplete(result_code); // [1] Calls service, resets state
CompletionOnceCallback callback = std::move(user_callback_);
service_->RemovePendingRequest(this); // [2] Only removed here, too late!
service_ = nullptr;
user_callback_.Reset();
std::move(callback).Run(result_code);
}
At [1], QueryDidComplete is called, which invokes Reset(), clearing resolve_job_ (setting is_started() to false). It then calls into the service:
// net/proxy_resolution/configured_proxy_resolution_request.cc:163-175
int ConfiguredProxyResolutionRequest::QueryDidComplete(int result_code) {
CHECK(!was_completed());
if (is_started()) { Reset(); } // resolve_job_.reset() -> is_started() == false
int rv = service_->DidFinishResolvingProxy(url_, ..., result_code, ...);
During DidFinishResolvingProxy, when the result code is ERR_PAC_SCRIPT_TERMINATED, reset_config is set to true:
// net/proxy_resolution/configured_proxy_resolution_service.cc:1338-1341
if (reset_config) {
ResetProxyConfig(false);
if (pending_requests_.size() > 1) // [3] still counted since RemovePendingRequest has not run
ApplyProxyConfigIfAvailable();
}
ApplyProxyConfigIfAvailable() initiates a re-resolution via InitializeUsingLastFetchedConfig(), which sets up InitProxyResolver and calls init_proxy_resolver_->Start(). If this completes synchronously:
// net/proxy_resolution/configured_proxy_resolution_service.cc:1614-1623
int rv = init_proxy_resolver_->Start(...);
if (rv != ERR_IO_PENDING)
OnInitProxyResolverComplete(rv); // -> SetReady()
SetReady() iterates through a copy of pending_requests_:
// net/proxy_resolution/configured_proxy_resolution_service.cc:1153-1167
auto pending_requests_copy = pending_requests_;
for (ConfiguredProxyResolutionRequest* req : pending_requests_copy) {
if (!ContainsPendingRequest(req)) continue;
if (!req->is_started()) {
req->StartAndCompleteCheckingForSynchronous(); // [4] Synch-dispatches outer `this`!
Because req->is_started() is false, StartAndCompleteCheckingForSynchronous() is executed on the outer request currently executing QueryComplete. Inside StartAndCompleteCheckingForSynchronous():
// net/proxy_resolution/configured_proxy_resolution_request.cc:139-149
void ConfiguredProxyResolutionRequest::StartAndCompleteCheckingForSynchronous() {
int rv = service_->TryToCompleteSynchronously(
url_, /*bypass_override_rules=*/false, net_log_, results_);
...
if (rv != ERR_IO_PENDING) {
QueryComplete(rv); // [5] Nested QueryComplete
}
}
If TryToCompleteSynchronously succeeds (e.g., fallback configuration resolves synchronously to DIRECT), a nested QueryComplete(OK) runs. This nested invocation consumes user_callback_, calls RemovePendingRequest(this), and invokes the user callback, which frees the request immediately:
// net/http/http_stream_factory_job_controller.cc:852-855
int HttpStreamFactory::JobController::DoResolveProxyComplete(int rv) {
DCHECK_NE(ERR_IO_PENDING, rv);
proxy_resolve_request_ = nullptr; // [6] Deletes and frees `this`
When control unwinds back to the outer QueryDidComplete:
// net/proxy_resolution/configured_proxy_resolution_request.cc:179-195
results_->set_proxy_resolve_start_time(creation_time_); // [7] UAF read/write!
results_->set_proxy_resolve_end_time(base::TimeTicks::Now());
...
if (!results_->traffic_annotation().is_valid())
results_->set_traffic_annotation(traffic_annotation_); // [8] UAF write!
...
traffic_annotation_.reset(); // [9] UAF write!
Accessing members via the freed this pointer constitutes a critical Use-After-Free.
Potential Trigger Steps
While proxy initialization is typically asynchronous, an attacker can reliably trigger the synchronous failure path:
- Initial State: The victim (on Linux, Mac, or Android) is configured with WPAD auto-detect. The attacker serves a valid PAC script. Chrome initializes the proxy resolver and creates a
PacFileDeciderPoller(configured_proxy_resolution_service.cc:1207). The poller is given the service'spac_file_fetcher_, which holds a persistent, transientNetworkAnonymizationKey(NAK) (pac_file_fetcher.h:79). - Concurrent Requests: The victim navigates to a page that triggers at least two concurrent network requests, creating two
ConfiguredProxyResolutionRequests that are added topending_requests_. - DNS Manipulation & Polling: The attacker manipulates the local DNS to return
NXDOMAINforwpad. ThePacFileDeciderPollertriggers a background poll (DoPoll). It triesWPAD_DHCP(which synchronously returnsERR_NOT_IMPLEMENTEDon these platforms) and falls back toWPAD_DNS, callingDoQuickCheck(). - Negative Cache Priming:
DoQuickCheck()issues aHostResolver::CreateRequestusing the fetcher's persistent transient NAK. TheHostResolverreceives theNXDOMAINresponse and populates theHostCachewith a negative entry keyed to this specific NAK. The poller finishes and posts a notification task (NotifyProxyResolutionServiceOfChange) to the thread's message loop queue (configured_proxy_resolution_service.cc:738). - Triggering the Race: Before the posted notification task executes, the attacker crashes the out-of-process PAC resolver (e.g., via a malformed PAC response causing an OOM). The OS closes the Mojo pipe. Chromium's event loop (
MessagePumpEpoll) processes this Mojo disconnect as a high-priority I/O event, executing the disconnect handler (ProxyResolverMojo::Job::OnMojoDisconnect) before the queued poller task. - Synchronous Re-initialization: The disconnect handler calls
CompleteRequest(ERR_PAC_SCRIPT_TERMINATED), triggering the outerQueryCompleteon the completing request.DidFinishResolvingProxyresets the config (destroying the poller and safely canceling its pending notification task) and callsApplyProxyConfigIfAvailable->InitializeUsingLastFetchedConfig->InitProxyResolver::Start. - Synchronous Failure:
InitProxyResolver::StarttriesWPAD_DHCP(syncERR_NOT_IMPLEMENTED) and falls back toWPAD_DNS.DoQuickCheck()issues aHostResolverrequest using the same persistent transient NAK.ResolveLocally()performs a cache lookup, hits the negative entry cached in step 4, and synchronously returnsERR_NAME_NOT_RESOLVED. - UAF Triggered: Because
InitProxyResolver::Startfails synchronously,SetReady()is called synchronously. It re-dispatches the completing request, invoking the nestedQueryComplete, which executes the consumer callback and frees the request object. Unwinding the stack to the outerQueryDidCompleteresults in the UAF.
Suggested Fix
Move service_->RemovePendingRequest(this) in ConfiguredProxyResolutionRequest::QueryComplete to occur before the call to QueryDidComplete. This ensures the request is no longer counted in pending_requests_ when DidFinishResolvingProxy executes, preventing it from satisfying pending_requests_.size() > 1 (if it was the last request) and preventing it from being re-dispatched by SetReady().
3. Technical Verification Details (Automated Audit Logs - Reviewers may skip this section)
Critic model verdict (2026-07-10 13:38:30):
Severity: High (S1)
Brief Notes / Reasoning: The report correctly identifies a structural re-entrancy flaw where
QueryCompletecan be invoked whilethisis still inpending_requests_. IfInitProxyResolver::Start()completes synchronously,SetReady()is called, which synchronously re-dispatches the request, invoking the user callback (which freesthis) and causing an outer-frame UAF write (results_->set_traffic_annotation(...)).The researcher assessed this as latent/unreachable, assuming
InitProxyResolver::Start()is always async. However, an attacker (A-NETCONF) can deterministically trigger a synchronous failure on Linux/Mac/Android (whereWPAD_DHCPfails synchronously):
- The attacker serves a valid WPAD IP, initializing the proxy resolver.
- The attacker changes
wpadDNS to NXDOMAIN.- The attacker forces Chrome to resolve
wpad(e.g., the PAC script returnsDIRECTforhttp://wpad/), populating the host resolver's negative cache.- The attacker triggers a crash in the PAC script (e.g., via OOM).
- Chrome processes
ERR_PAC_SCRIPT_TERMINATED, re-initializes, and hits the synchronous negative cache forwpad.InitProxyResolver::Startfails synchronously,SetReady()is called, and the UAF is triggered.MiraclePtr does not mitigate this since the freed object is accessed via the on-stack
thispointer. By grooming the heap, the attacker can control the freed object, gaining an arbitrary 32-bit write primitive in the network service. Since the network service is unsandboxed on Linux and Android, this is a sandbox escape. Rated S1 (High) per guidelines (memory corruption in unsandboxed network process requiring a groom).
Double-Check Validator Notes:
The prior Critic's general UAF logic holds, but the specific trigger mechanism required correction. The Critic asserted the attacker could prime the negative DNS cache via a PAC script. This is incorrect because PacFileDecider::QuickCheck uses the PacFileFetcher's IsolationInfo::CreateTransient(). Chrome's HostCache is partitioned by the NetworkAnonymizationKey (NAK), meaning the transient NAK guarantees a cache miss against entries populated by general web requests or the PAC script itself.
However, synchronous failure IS reachable via the PacFileDeciderPoller. The poller uses the exact same pac_file_fetcher_ instance as the main service (configured_proxy_resolution_service.cc:1212), which retains a persistent IsolationInfo and transient NAK (pac_file_fetcher.h:79-80). When the poller executes, its wpad DNS check caches a negative entry under this specific transient NAK. If a Mojo disconnect occurs while the poller's completion task is queued on the message loop, the event loop (e.g., MessagePumpEpoll) processes the Mojo disconnect as an I/O event prior to executing queued tasks. This causes ProxyResolverMojo::Job::OnMojoDisconnect to run before the poller task. The resulting proxy re-initialization then issues a wpad DNS query using the identical transient NAK, hitting the negative cache synchronously (HostResolverManager::ResolveLocally). This completes the synchronous loop to SetReady() and triggers the UAF as described. MiraclePtr (BRP) does not protect accesses made directly from a freed this pointer traversing to member variables (results_, creation_time_, traffic_annotation_, service_), resulting in an exploitable UAF in the unsandboxed network service (S1).
Evaluated with Chrome root at commit: f4cb78b4ec077b7f51b504af9350cdc166d10c2f
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
The request removes itself from the pending list only after calling into the service, so a synchronous re-initialisation failure re-dispatches and frees it nestedly while the outer frame still uses it.
Impact
Because the network service is unsandboxed on Linux, Mac, ChromeOS and Android, the use-after-free could potentially be exploited for remote code execution, though the report notes heap grooming is needed and MiraclePtr does not mitigate it.
What the attacker needed
Victim uses WPAD auto-detect; attacker controls local DNS; victim loads a page with concurrent requests; attacker can crash the PAC resolver
The fix
The request should be removed from the pending list before calling into the service, so it cannot be re-dispatched by SetReady.
How it was found
- Victim is configured with WPAD auto-detect and the attacker serves a valid PAC script, creating a poller with a persistent transient network key.
- The victim loads a page producing at least two concurrent proxy resolution requests.
- The attacker makes DNS return NXDOMAIN for the wpad host so the poller's quick check caches a negative entry under that key.
- Before the poller's queued notification runs, the attacker crashes the PAC resolver so the Mojo disconnect is handled first.
- The disconnect triggers re-initialisation, which hits the negative DNS cache and fails synchronously, calling SetReady.
- SetReady re-dispatches the completing request, the nested completion frees it, and the outer frame then accesses freed members.
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.
When Chrome works out which proxy to use, it keeps a list of requests waiting for an answer. This report shows that a request can be answered, removed and deleted while the code that started it is still running, so the older code then touches memory that no longer belongs to it. That kind of mistake (use after free) can let an attacker who controls the local network influence what is written into that freed memory.
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.