Extensions: WT: Fix UAF in WebTransport proxy during profile teardown [chromium/src : main]

0 views
Skip to first unread message

Solomon Kinard (Gerrit)

unread,
2:12 AM (15 hours ago) 2:12 AM
to chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org

Solomon Kinard has uploaded the change for review

Commit message

Extensions: WT: Fix UAF in WebTransport proxy during profile teardown

When an Incognito window is closed, hanging WebTransport connections
can cause the proxy to outlive its associated `BrowserContext`.
Because `WebRequestAPI` spans both regular and Incognito profiles,
proxies tied to the Incognito context miss the standard KeyedService
shutdown event. When the hanging network connection eventually times
out or errors, the proxy attempts to access the destroyed
`BrowserContext`, triggering a fatal BackupRefPtr (BRP) Use-After-Free
crash.

This CL fixes the Use-After-Free by:
1. Introducing `WebRequestProxyingWebTransportShutdownNotifierFactory`
to proactively listen for the specific `BrowserContext`'s
destruction.
2. Updating `WebTransportHandshakeProxy` to subscribe to this notifier
and cleanly self-destruct (and sever its Mojo pipes) before the
profile memory is quarantined.
3. Adding factory dependencies to ensure `WebRequestEventRouterFactory`
outlives `WebRequestAPI` so network errors can be safely broadcasted
during the teardown sequence.

Additionally, a comprehensive regression test is added to
deterministically race asynchronous cross-process WebTransport Mojo
network errors against Incognito profile destruction.
Bug: 483990346
Change-Id: Iba66e007ad74ebc48f60b3824e9a27d162f519cd

Change diff


Change information

Files:
  • M chrome/browser/extensions/api/web_request/web_request_apitest.cc
  • M extensions/browser/BUILD.gn
  • M extensions/browser/api/api_browser_context_keyed_service_factories.cc
  • M extensions/browser/api/web_request/web_request_api.h
  • M extensions/browser/api/web_request/web_request_proxying_webtransport.cc
  • A extensions/browser/api/web_request/web_request_proxying_webtransport_shutdown_notifier_factory.cc
  • A extensions/browser/api/web_request/web_request_proxying_webtransport_shutdown_notifier_factory.h
Change size: M
Delta: 7 files changed, 208 insertions(+), 2 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Iba66e007ad74ebc48f60b3824e9a27d162f519cd
Gerrit-Change-Number: 7888656
Gerrit-PatchSet: 1
Gerrit-Owner: Solomon Kinard <solomo...@chromium.org>
Gerrit-Reviewer: Solomon Kinard <solomo...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Solomon Kinard (Gerrit)

unread,
10:15 AM (7 hours ago) 10:15 AM
to Devlin Cronin, Ryan Sultanem, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org
Attention needed from Devlin Cronin

Solomon Kinard added 1 comment

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Solomon Kinard . resolved

Review extensions related code?

Open in Gerrit

Related details

Attention is currently required from:
  • Devlin Cronin
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Iba66e007ad74ebc48f60b3824e9a27d162f519cd
Gerrit-Change-Number: 7888656
Gerrit-PatchSet: 8
Gerrit-Owner: Solomon Kinard <solomo...@chromium.org>
Gerrit-Reviewer: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Reviewer: Solomon Kinard <solomo...@chromium.org>
Gerrit-CC: Ryan Sultanem <rs...@google.com>
Gerrit-Attention: Devlin Cronin <rdevlin...@chromium.org>
Gerrit-Comment-Date: Mon, 01 Jun 2026 14:15:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Devlin Cronin (Gerrit)

unread,
1:52 PM (3 hours ago) 1:52 PM
to Solomon Kinard, Andrea Orru, Ryan Sultanem, Chromium LUCI CQ, chromium...@chromium.org, chromium-a...@chromium.org, extension...@chromium.org, Devlin Cronin
Attention needed from Andrea Orru

Devlin Cronin added 1 comment

Patchset-level comments
Devlin Cronin . resolved

Thanks, Solomon!

webRequest -> andreaorru

(Feel free to add me back if there's anything that needs my specific review)

Open in Gerrit

Related details

Attention is currently required from:
  • Andrea Orru
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Iba66e007ad74ebc48f60b3824e9a27d162f519cd
Gerrit-Change-Number: 7888656
Gerrit-PatchSet: 8
Gerrit-Owner: Solomon Kinard <solomo...@chromium.org>
Gerrit-Reviewer: Andrea Orru <andre...@chromium.org>
Gerrit-Reviewer: Solomon Kinard <solomo...@chromium.org>
Gerrit-CC: Ryan Sultanem <rs...@google.com>
Gerrit-Attention: Andrea Orru <andre...@chromium.org>
Gerrit-Comment-Date: Mon, 01 Jun 2026 17:52:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages