Insufficient validation of untrusted input in Contextual Tasks (CVE-2026-19169)
Chromium's Contextual Tasks WebUI accepted an attacker-supplied chrome_host parameter without applying the existing trusted-host check, so the managed webview could be rewritten to an attacker origin. That origin then received the browser-managed bearer token for eligible Google requests and could read CORS-readable Google Workspace exports, spoof the WebUI and expose the signed-in user's email address.
Originally disclosed on Chrome VRP
- Fix shipped in 17 days
Steps to reproduce the problem
Affected version
Chrome: 152.0.7956.0 (or head)
Local build arguments:
is_debug = false
is_component_build = true
symbol_level = 1
blink_symbol_level = 0
v8_symbol_level = 0
Steps to reproduce
Place opener.html, poc.html, server.py, and localhost_chrome_host.diff together in a folder.
-
Apply the attached patch and build Chromium:
CMD git apply localhost_chrome_host.diff autoninja -C out\Default chromeNote: The patch only maps our local server value to
chrome_host—chrome_host=127.0.0.1:8000. A public attacker controlled HTTPS origin does not require this patch e.g.malicious.example.com. -
Start the server:
CMD python server.py --host 127.0.0.1 --port 8000Launch the patched browser:
CMD out\Default\chrome.exe --enable-features=ContextualTasks "http://127.0.0.1:8000/opener.html" -
Sign in or be signed into a Google account.
-
In your Google account, create:
- A Google Doc containing any unique test text.
- A Google Sheet containing any unique test text.
Record both IDs of the docs and or sheets documents.
-
In opener.html click Open evidence suite.
-
Under 2. Pre-existing private known-ID reads, Enter the private Doc and or Sheet IDs
-
Observe HTTP 200 CORS-readable responses containing the contents of the files.
Note: In a real world drive-by attack, everything would be done automatically without the need for the clicking and entering in values.
Problem Description
Security impact
A Google Search/AI Mode URL can supply an attacker-controlled chrome_host. Chromium preserves that value in the chrome://contextual-tasks URL without applying the existing IsTrustedHost() check, and the WebUI then rewrites its managed <webview> to the an attacker’s origin.
After the attacker page commits as the guest:
- attacker controlled origin is accepted by the AIM
postMessagebridge; - binary
AimToClientMessagedata reaches browser-process C++; - eligible Google requests from the guest receive the browser-managed Contextual Tasks bearer token and
- CORS-readable Google Workspace exports can be returned to attacker JavaScript.
- Full spoof of WebUI which leads to a very convincing spoof. Click the Open Gemini visual spoof button on opener.html for the spoof.
- Exposed the signed-in user’s email address.
Root cause
1. The intercepted URL is retained as task state
chrome/browser/contextual_tasks/contextual_tasks_ui_service.cc
ContextualTask task = contextual_tasks_service_->CreateTaskFromUrl(url);
task_id_to_creation_url_[task.GetTaskId()] = url;
GURL ui_url = GetContextualTaskUrlForTask(task.GetTaskId());
The complete attacker-controlled URL, including chrome_host, is preserved.
2. GetHostForTask() returns chrome_host without validation
GetHostForTask() extracts chrome_host from the stored creation URL and appends it to the privileged WebUI URL. That path does not call the existing IsTrustedHost() allowlist.
An input such as chrome_host=example.com therefore becomes part of:
chrome://contextual-tasks/...&chrome_host=example.com
3. The renderer reads the raw WebUI query parameter
chrome/browser/resources/contextual_tasks/app.ts
const webUiUrlOnLoad = new URL(window.location.href);
this.host_ = webUiUrlOnLoad.searchParams.get(CHROME_HOST_PARAM_KEY);
if (!this.host_ && loadTimeData.valueExists('chrome_host')) {
this.host_ = loadTimeData.getString('chrome_host');
}
C++ validates the value before exposing it through loadTimeData, but the raw window.location value is read first, so the validated fallback is bypassed.
4. The raw host rewrites managed-webview requests
ContextualTasksAppElement.onBeforeRequest() rewrites non-sign-in requests:
if (this.host_ && !isSigninDomain) {
newUrl.host = this.host_;
}
A value such as chrome_host=attacker.example therefore redirects the managed guest to https://attacker.example/....
5. The committed attacker origin becomes the accepted AIM origin
post_message_handler.ts updates targetOrigin_ to the final committed guest origin. Messages from that origin are then accepted, and binary data is forwarded to the Mojo page handler.
ContextualTasksPageHandler::OnWebviewMessage() parses those bytes as privileged lens::AimToClientMessage commands. There is no second trusted-origin check in the C++ handler.
6. Eligible guest requests receive Contextual Tasks authorization
contextual_tasks_url_loader_factory_interceptor.cc installs its proxy factory for a WebView guest owned by chrome://contextual-tasks. For eligible Google destinations, it obtains the Contextual Tasks token and adds:
Authorization: Bearer <token>
Bisect
Introducing commit: d641edfa583c8d647e12f4d5ad5f433ea71260a5
Before this commit, the renderer used only a C++-provided loadTimeData host derived from GetForcedEmbeddedPageHost(), which restricted overrides to approved Google/Googlers domains. The introducing commit added URL persistence, direct window.location parsing, and newUrl.host = this.host_.
Limitations
-
Requires user to be signed-in Google account.
-
The private read requires a known Doc or Sheet ID. However, this is not uncommon. For example, many Chromium design docs are invite only, as they contain sensitive information, but expose the ID in the share URL e.g. a drive-by attack could expose this internal Googler's design document: https://issues.chromium.org/issues/524671711 — https://docs.google.com/document/d/1Q6LFdVyA-Ug8IAySVixEzsKYRe6JqOWmgkc4pV0ksJ4/edit?tab=t.0
Summary
Unvalidated chrome_host param allows attacker-controlled webview inside chrome://contextual-tasks
Custom Questions
Type of crash:
N/A
Crash state:
N/A
Reporter credit:
Sven Dysthe @svn_dy
Additional Data
Category: Security
Chrome Channel: Canary
Regression: Yes \
Insufficient validation of untrusted input in Contextual Tasks (CVE-2026-19169)
Context
Contextual Tasks is a Chrome feature that embeds a managed <webview> inside the privileged chrome://contextual-tasks WebUI. The feature is enabled with the ContextualTasks flag and is tied to a signed-in Google account. A Google Search or AI Mode URL can carry a chrome_host parameter, which the WebUI uses to decide which host the embedded guest should load. The report notes that an existing IsTrustedHost() check is not applied on this path.
The report describes what happens when that validation is skipped: an attacker-controlled chrome_host survives into the privileged WebUI URL, the managed webview is rewritten to the attacker's origin, and the attacker page then inherits the Contextual Tasks bridge, including a browser-managed bearer token for eligible Google requests.
Setup
Affected version: Chrome 152.0.7956.0 (or head).
The researcher built Chromium locally with these arguments:
is_debug = false
is_component_build = true
symbol_level = 1
blink_symbol_level = 0
v8_symbol_level = 0
Four files are placed together in one folder: opener.html, poc.html, server.py and localhost_chrome_host.diff. The patch is only a convenience for local testing: it maps the local server value to chrome_host, namely chrome_host=[redacted]:8000. A public attacker-controlled HTTPS origin does not require the patch, for example malicious.example.com.
Preconditions:
- The user must be signed in to a Google account.
- For the private read, the attacker needs a known Google Doc or Sheet ID. The report notes this is not uncommon: many Chromium design docs are invite only but expose the ID in the share URL.
Finding it
A chrome_host value supplied through a Google Search/AI Mode URL is preserved in the chrome://contextual-tasks URL without the existing IsTrustedHost() check being applied. The WebUI then rewrites its managed <webview> to that host. Because the guest is owned by the privileged WebUI, the committed attacker origin is later accepted by the AIM postMessage bridge, and binary AimToClientMessage data reaches browser-process C++.
A bisect points to the introducing commit [redacted]. Before that commit, the renderer used only a C++-provided loadTimeData host derived from GetForcedEmbeddedPageHost(), which restricted overrides to approved Google/Googlers domains. The introducing commit added URL persistence, direct window.location parsing, and newUrl.host = this.host_.
Exploitation
Step 1: apply the patch and build
git apply localhost_chrome_host.diff
autoninja -C out\Default chrome
The patch only maps the local server value to chrome_host (chrome_host=[redacted]:8000). It is not needed against a real attacker-controlled HTTPS origin.
Step 2: start the server and launch the browser
python server.py --host [redacted] --port 8000
out\Default\chrome.exe --enable-features=ContextualTasks "http://[redacted]:8000/opener.html"
The browser is launched with the Contextual Tasks feature enabled and the opener page loaded from the local server.
Step 3: sign in
Sign in, or be already signed in, to a Google account.
Step 4: create test documents
In the Google account, create:
- a Google Doc containing any unique test text;
- a Google Sheet containing any unique test text.
Record both IDs of the documents.
Step 5: open the evidence suite
In opener.html, click Open evidence suite.
Step 6: enter the private IDs
Under 2. Pre-existing private known-ID reads, enter the private Doc and/or Sheet IDs.
Step 7: observe the responses
The result is HTTP 200 CORS-readable responses containing the contents of the files.
The report notes that in a real-world drive-by attack everything would be done automatically, without the clicking and entering of values.
Root cause
1. The intercepted URL is retained as task state
chrome/browser/contextual_tasks/contextual_tasks_ui_service.cc:
ContextualTask task = contextual_tasks_service_->CreateTaskFromUrl(url);
task_id_to_creation_url_[task.GetTaskId()] = url;
GURL ui_url = GetContextualTaskUrlForTask(task.GetTaskId());
The complete attacker-controlled URL, including chrome_host, is preserved.
2. GetHostForTask() returns chrome_host without validation
GetHostForTask() extracts chrome_host from the stored creation URL and appends it to the privileged WebUI URL. That path does not call the existing IsTrustedHost() allowlist. An input such as chrome_host=example.com therefore becomes part of:
chrome://contextual-tasks/...&chrome_host=example.com
3. The renderer reads the raw WebUI query parameter
chrome/browser/resources/contextual_tasks/app.ts:
const webUiUrlOnLoad = new URL(window.location.href);
this.host_ = webUiUrlOnLoad.searchParams.get(CHROME_HOST_PARAM_KEY);
if (!this.host_ && loadTimeData.valueExists('chrome_host')) {
this.host_ = loadTimeData.getString('chrome_host');
}
C++ validates the value before exposing it through loadTimeData, but the raw window.location value is read first, so the validated fallback is bypassed.
4. The raw host rewrites managed-webview requests
ContextualTasksAppElement.onBeforeRequest() rewrites non-sign-in requests:
if (this.host_ && !isSigninDomain) {
newUrl.host = this.host_;
}
A value such as chrome_host=attacker.example therefore redirects the managed guest to https://attacker.example/....
5. The committed attacker origin becomes the accepted AIM origin
post_message_handler.ts updates targetOrigin_ to the final committed guest origin. Messages from that origin are then accepted, and binary data is forwarded to the Mojo page handler. ContextualTasksPageHandler::OnWebviewMessage() parses those bytes as privileged lens::AimToClientMessage commands. There is no second trusted-origin check in the C++ handler.
6. Eligible guest requests receive Contextual Tasks authorization
contextual_tasks_url_loader_factory_interceptor.cc installs its proxy factory for a WebView guest owned by chrome://contextual-tasks. For eligible Google destinations, it obtains the Contextual Tasks token and adds:
Authorization: Bearer <token>
Impact
After the attacker page commits as the guest:
- the attacker-controlled origin is accepted by the AIM
postMessagebridge; - binary
AimToClientMessagedata reaches browser-process C++; - eligible Google requests from the guest receive the browser-managed Contextual Tasks bearer token;
- CORS-readable Google Workspace exports can be returned to attacker JavaScript;
- the WebUI can be fully spoofed, which the report describes as a very convincing spoof (the Open Gemini visual spoof button on
opener.htmldemonstrates it); - the signed-in user's email address is exposed.
Limitations: the attack requires a signed-in Google account, and the private read requires a known Doc or Sheet ID. The report gives the example of an invite-only Chromium design document whose ID is exposed in the share URL, which a drive-by attack could expose.
Fix
The report does not describe the fix that was applied. The root cause points to the missing IsTrustedHost() validation on the chrome_host value taken from the stored creation URL, and to the renderer preferring the raw window.location parameter over the validated loadTimeData value.
Variants to test
- Other WebUI features that accept a host or origin parameter from a search or AI Mode URL. A positive result is the parameter surviving into the privileged
chrome://URL and being used to rewrite a managed webview or iframe. - Renderer code that reads
window.locationbefore falling back toloadTimeData. A positive result is a value that bypasses the C++ validation and reaches a privileged sink. postMessagebridges that updatetargetOrigin_from the committed guest origin. A positive result is a message from an attacker origin being forwarded to a Mojo handler that parses it as a privileged command.- URL loader factory interceptors that attach a bearer token for eligible destinations. A positive result is an attacker-controlled guest receiving the token on requests to those destinations.
- Known-ID private document reads through CORS-readable exports. A positive result is an HTTP 200 response containing the document contents, readable from attacker JavaScript.
What happened, in plain words
Chrome has a feature called Contextual Tasks. Think of it as a small, trusted window that Chrome opens inside one of its own internal pages. That internal page lives at an address starting with chrome://, which is a special prefix that only Chrome's own built-in pages use. Normal websites cannot use it. Because those pages are part of the browser itself, Chrome gives them extra powers that ordinary websites never get.
Inside that trusted window, Chrome loads a separate web page. This is done with something called a <webview>: a way for one page to show another page inside a frame, like a picture-in-picture television inside a bigger television. The page shown inside the frame is called the guest, and the page that hosts it is called the host.
The Contextual Tasks feature is meant to show Google content, for example results from Google Search or from AI Mode (Google's AI-powered search experience). To know which Google site to load, the feature reads a value called chrome_host from the URL. A URL parameter is the part of a web address after a question mark, like ?colour=blue; it is a small piece of data the address carries along. So chrome_host is simply a piece of text in the address that says "load this host".
Chrome has an existing check called IsTrustedHost(), but the bug is that this check is skipped on one path. That check is called IsTrustedHost(). The bug is that this check is skipped on one path, so an attacker can put their own website into chrome_host, and Chrome will happily load the attacker's site inside its own trusted window.
Once the attacker's page is loaded inside that trusted window, several bad things follow. The attacker's page can talk to Chrome through a messaging channel that was only meant for trusted Google pages. It can receive a bearer token, which is a secret string that proves "this request is allowed to act on behalf of the signed-in user". With that token, the attacker's page can ask Google for the user's private documents and read the answers. It can also draw a fake version of the Chrome interface that looks completely real, and it can learn the signed-in user's email address.
This class of bug is called insufficient validation of untrusted input. In everyday terms: a form asks you for your name, and the clerk writes whatever you say straight onto an official document without checking it. If you write something rude or something that looks like an instruction, it ends up on the official document. The fix is to check the input before using it. Here, Chrome failed to check the chrome_host value before using it to decide which site to load.
The bug was assigned the identifier CVE-2026-19169. A CVE is a public catalogue number for a known security flaw, so that everyone can refer to the same issue by the same name. It was reported through Google's Chrome VRP (Vulnerability Reward Program), which pays researchers for finding bugs. The researcher is credited as Sven Dysthe (@svn-dys), the severity is high, and the bounty was 5000.00 USD. It was disclosed on 2026-08-06.
Context
Contextual Tasks is a Chrome feature that embeds a managed <webview> inside the privileged chrome://contextual-tasks WebUI. Let us unpack that sentence.
- WebUI: Chrome's internal pages, the ones at
chrome://addresses. They are written by Chrome's own developers and are trusted by the browser. Examples include the settings page and the downloads page. - Privileged: having special powers that ordinary web pages do not have. A privileged page can, for example, ask the browser to attach the user's login credentials to requests.
- Managed
<webview>: a<webview>whose behaviour is controlled by the host page. The host can decide which address the guest loads, and can intercept the guest's network requests before they go out. - Flag: a switch that turns an experimental feature on or off. The feature here is enabled with the
ContextualTasksflag. - Signed-in Google account: the user is logged in to Google in Chrome, so Chrome holds credentials on their behalf.
A Google Search or AI Mode URL can carry a chrome_host parameter, which the WebUI uses to decide which host the embedded guest should load. The report notes that an existing IsTrustedHost() check is not applied on this path. An allowlist is the opposite of a blocklist: instead of listing what is forbidden, it lists exactly what is permitted, and everything else is refused. Here the allowlist contains approved Google origins, so the guest stays on Google sites.
The report describes what happens when that validation is skipped: an attacker-controlled chrome_host survives into the privileged WebUI URL, the managed webview is rewritten to the attacker's origin, and the attacker page then inherits the Contextual Tasks bridge, including a browser-managed bearer token for eligible Google requests.
A few more terms before we go on:
- Origin: the combination of scheme (http or https), host name and port.
https://example.comandhttps://evil.exampleare different origins. Browsers use origins to decide what a page is allowed to touch. - Bridge: a piece of code that lets two separate worlds talk to each other. Here, the bridge lets the guest page send messages to Chrome's own code.
- Bearer token: a secret string that is sent with a request to prove the sender is authorised. The word "bearer" means "whoever carries this token is trusted", like a wristband at a festival: anyone wearing it gets in, no questions asked.
- Eligible Google requests: requests to Google addresses that the Contextual Tasks feature is willing to attach the token to.
Setup
Affected version: Chrome 152.0.7956.0 (or head). "Head" means the very latest development code, the tip of the project's source tree.
The researcher built Chromium locally with these arguments:
is_debug = false
is_component_build = true
symbol_level = 1
blink_symbol_level = 0
v8_symbol_level = 0
This is a GN file, the configuration language Chromium uses to describe how to build itself. Line by line:
is_debug = false: build an optimised (release-style) browser rather than a slow debugging build. This makes the browser behave more like the real thing.is_component_build = true: split the build into many small shared libraries instead of one giant binary. This makes rebuilds much faster, which matters when you are iterating on a proof of concept.symbol_level = 1: include a moderate amount of debugging information, enough to make crash reports and stack traces readable without making the build enormous.blink_symbol_level = 0: include no debugging information for Blink, Chrome's rendering engine. Blink is huge, so this saves a lot of build time and disk space.v8_symbol_level = 0: same idea for V8, Chrome's JavaScript engine.
Four files are placed together in one folder: opener.html, poc.html, server.py and localhost_chrome_host.diff. The patch is only a convenience for local testing: it maps the local server value to chrome_host, namely chrome_host=[redacted]:8000. A patch is a small file describing changes to source code; applying it modifies the code before building. [redacted] is the loopback address, a special address that always means "this same computer", so a server running there is only reachable from the machine itself. 8000 is the port, a numbered door on the computer that a server listens on.
A public attacker-controlled HTTPS origin does not require the patch, for example malicious.example.com. In other words, the patch exists only because the researcher wanted to test with a local server; a real attacker would simply use a real website they control.
Preconditions:
- The user must be signed in to a Google account.
- For the private read, the attacker needs a known Google Doc or Sheet ID. The report notes this is not uncommon: many Chromium design docs are invite only but expose the ID in the share URL.
A Google Doc or Sheet ID is the long random-looking string in the middle of a Google Docs or Sheets address. It identifies one specific document. Knowing the ID does not by itself give you access, but if the browser can be tricked into fetching the document with the user's credentials, the ID is all the attacker needs to ask for it.
Finding it
A chrome_host value supplied through a Google Search/AI Mode URL is preserved in the chrome://contextual-tasks URL without the existing IsTrustedHost() check being applied. The WebUI then rewrites its managed <webview> to that host. Because the guest is owned by the privileged WebUI, the committed attacker origin is later accepted by the AIM postMessage bridge, and binary AimToClientMessage data reaches browser-process C++.
Let us unpack that last sentence, because it is dense.
- AIM: the internal name for the AI Mode part of the feature.
postMessage: a standard browser mechanism that lets one window send a message to another window. It is like passing a note through a slot in a door.- Committed origin: the origin of the page that actually finished loading in the guest. "Commit" is the moment the browser decides which page is now the current one in a frame.
- Binary
AimToClientMessagedata: messages in a compact binary format (not plain text) that the AI Mode side sends to the client side. The client is the browser's own code. - Browser-process C++: Chrome runs in several processes. The renderer process runs web pages and is treated as untrusted. The browser process is the trusted core that controls the whole browser. It is written in C++. Getting attacker data into the browser process is serious, because that is where the powerful code lives.
A bisect is a debugging technique: you have a known-good version and a known-bad version, and you repeatedly test the midpoint to narrow down which change introduced the problem. It works like guessing a number between 1 and 100 by halving the range each time.
The bisect points to the introducing commit [redacted]. A commit is one recorded change to the source code, identified by a long hash. Before that commit, the renderer used only a C++-provided loadTimeData host derived from GetForcedEmbeddedPageHost(), which restricted overrides to approved Google/Googlers domains. loadTimeData is a mechanism where the trusted C++ side hands values to the page's JavaScript; because C++ fills it in, the values can be trusted. The introducing commit added URL persistence, direct window.location parsing, and newUrl.host = this.host_. In other words, the new code started trusting a value that came straight from the address bar instead of the value that C++ had checked.
Exploitation
Step 1: apply the patch and build
git apply localhost_chrome_host.diff
autoninja -C out\Default chrome
Line by line:
git apply localhost_chrome_host.diff: tell the version-control tool git to apply the changes described in the patch file. This is how the local test server address gets accepted as achrome_hostvalue.autoninja -C out\Default chrome: build thechrometarget using ninja, a build tool, with the build output going into the folderout\Default.autoninjais a wrapper that picks sensible settings automatically.
The patch only maps the local server value to chrome_host (chrome_host=[redacted]:8000). It is not needed against a real attacker-controlled HTTPS origin.
Step 2: start the server and launch the browser
python server.py --host [redacted] --port 8000
This starts a small web server written in Python. --host [redacted] tells it to listen only on the local machine, and --port 8000 tells it which numbered door to listen on. The server serves the proof-of-concept pages.
out\Default\chrome.exe --enable-features=ContextualTasks "http://[redacted]:8000/opener.html"
This launches the freshly built browser. --enable-features=ContextualTasks is a command-line switch that turns the Contextual Tasks feature on, because it may not be on by default in this build. The quoted address is the page to open at startup: the opener page served by the local server.
Step 3: sign in
Sign in, or be already signed in, to a Google account. This matters because the whole attack depends on Chrome holding the user's Google credentials and being willing to attach them to requests made from the guest.
Step 4: create test documents
In the Google account, create:
- a Google Doc containing any unique test text;
- a Google Sheet containing any unique test text.
Record both IDs of the documents. The unique text is there so that, when the attacker page later receives a response, you can see at a glance that it really contains the document's contents and not some generic page.
Step 5: open the evidence suite
In opener.html, click Open evidence suite. The opener page is a control panel that runs the individual demonstrations.
Step 6: enter the private IDs
Under 2. Pre-existing private known-ID reads, enter the private Doc and/or Sheet IDs. This section of the page tests whether a document that already existed and was never shared can be read.
Step 7: observe the responses
The result is HTTP 200 CORS-readable responses containing the contents of the files.
- HTTP 200: the standard success status code a web server returns when a request worked.
- CORS: Cross-Origin Resource Sharing, the browser rule that decides whether JavaScript on one origin may read the response from another origin. By default it may not; a server has to explicitly allow it. "CORS-readable" means the attacker's JavaScript was actually allowed to read the response body, not just send the request.
The report notes that in a real-world drive-by attack everything would be done automatically, without the clicking and entering of values. A drive-by attack is one where the victim only has to visit a page; no further interaction is needed.
Root cause
1. The intercepted URL is retained as task state
chrome/browser/contextual_tasks/contextual_tasks_ui_service.cc:
ContextualTask task = contextual_tasks_service_->CreateTaskFromUrl(url);
task_id_to_creation_url_[task.GetTaskId()] = url;
GURL ui_url = GetContextualTaskUrlForTask(task.GetTaskId());
This is C++, the language Chrome's trusted core is written in. Line by line:
ContextualTask task = contextual_tasks_service_->CreateTaskFromUrl(url);: create a new Contextual Task from the URL that was intercepted. The->is C++ syntax for calling a method on an object.task_id_to_creation_url_[task.GetTaskId()] = url;: store the original URL in a lookup table, keyed by the task's ID. This is the crucial line: the whole URL, including the attacker'schrome_host, is saved for later.GURL ui_url = GetContextualTaskUrlForTask(task.GetTaskId());: build the internalchrome://address for this task.GURLis Chrome's URL type.
The complete attacker-controlled URL, including chrome_host, is preserved.
2. GetHostForTask() returns chrome_host without validation
GetHostForTask() extracts chrome_host from the stored creation URL and appends it to the privileged WebUI URL. That path does not call the existing IsTrustedHost() allowlist. An input such as chrome_host=example.com therefore becomes part of:
chrome://contextual-tasks/...&chrome_host=example.com
Read that address as: the trusted internal page, followed by other parameters (the ...), then an ampersand & which separates parameters, then the attacker's value. The & is just the separator between one parameter and the next, like a comma between items in a list.
3. The renderer reads the raw WebUI query parameter
chrome/browser/resources/contextual_tasks/app.ts:
const webUiUrlOnLoad = new URL(window.location.href);
this.host_ = webUiUrlOnLoad.searchParams.get(CHROME_HOST_PARAM_KEY);
if (!this.host_ && loadTimeData.valueExists('chrome_host')) {
this.host_ = loadTimeData.getString('chrome_host');
}
This is TypeScript, a variant of JavaScript with type annotations. Line by line:
const webUiUrlOnLoad = new URL(window.location.href);: take the current page address (window.location.href) and parse it into a structured URL object.window.locationis the browser's built-in object describing the current address.this.host_ = webUiUrlOnLoad.searchParams.get(CHROME_HOST_PARAM_KEY);: read thechrome_hostparameter straight out of that address and store it.searchParamsis the part of the URL object that holds the parameters after the question mark.if (!this.host_ && loadTimeData.valueExists('chrome_host')) {: only if nothing was found in the address, and only if the trusted C++ side provided achrome_hostvalue, then...this.host_ = loadTimeData.getString('chrome_host');: ...use the trusted value instead.
C++ validates the value before exposing it through loadTimeData, but the raw window.location value is read first, so the validated fallback is bypassed. The order matters: the code checks the untrusted source first and only falls back to the trusted source if the untrusted one is empty. An attacker simply makes sure it is not empty.
4. The raw host rewrites managed-webview requests
ContextualTasksAppElement.onBeforeRequest() rewrites non-sign-in requests:
if (this.host_ && !isSigninDomain) {
newUrl.host = this.host_;
}
Line by line:
if (this.host_ && !isSigninDomain) {: if a host value is set, and the request is not going to the sign-in domain, then...newUrl.host = this.host_;: ...replace the host part of the outgoing request's address with the attacker's value.
A value such as chrome_host=attacker.example therefore redirects the managed guest to https://attacker.example/.... The sign-in domain is excluded, presumably so that the login flow keeps working normally; everything else is fair game.
5. The committed attacker origin becomes the accepted AIM origin
post_message_handler.ts updates targetOrigin_ to the final committed guest origin. Messages from that origin are then accepted, and binary data is forwarded to the Mojo page handler. ContextualTasksPageHandler::OnWebviewMessage() parses those bytes as privileged lens::AimToClientMessage commands. There is no second trusted-origin check in the C++ handler.
A few terms:
targetOrigin_: the origin that the messaging code is willing to accept messages from. It is meant to be a trusted Google origin.- Mojo: Chrome's internal messaging system that lets different parts of the browser talk to each other, including across process boundaries. Think of it as the internal postal service of the browser.
- Page handler: the C++ object on the trusted side that receives messages from the page.
lens::AimToClientMessage: a specific message type in the AI Mode code. Thelens::prefix is a C++ namespace, a way of grouping related names together.
The chain is: the guest commits at the attacker's origin, the messaging code updates its accepted origin to match, messages from the attacker are therefore accepted, and the C++ handler parses them as if they came from a trusted Google page.
6. Eligible guest requests receive Contextual Tasks authorization
contextual_tasks_url_loader_factory_interceptor.cc installs its proxy factory for a WebView guest owned by chrome://contextual-tasks. For eligible Google destinations, it obtains the Contextual Tasks token and adds:
Authorization: Bearer <token>
This is an HTTP header. A header is a labelled line of extra information sent with a request or response, like the address block on an envelope. Authorization is the header name, and Bearer <token> is its value: the word Bearer, a space, then the actual secret token. The <token> is a placeholder for the real secret, which is why it is written in angle brackets.
A URL loader factory interceptor is a hook in Chrome's networking layer that can inspect and modify outgoing requests. Because the guest is owned by the privileged chrome://contextual-tasks page, the interceptor treats its requests as coming from that trusted page and attaches the token. The attacker's page, sitting in the guest, gets the benefit without ever having been trusted.
Impact
After the attacker page commits as the guest:
- the attacker-controlled origin is accepted by the AIM
postMessagebridge; - binary
AimToClientMessagedata reaches browser-process C++; - eligible Google requests from the guest receive the browser-managed Contextual Tasks bearer token;
- CORS-readable Google Workspace exports can be returned to attacker JavaScript;
- the WebUI can be fully spoofed, which the report describes as a very convincing spoof (the Open Gemini visual spoof button on
opener.htmldemonstrates it); - the signed-in user's email address is exposed.
A spoof is a fake that is designed to look real. Here, the attacker's page can draw something that looks exactly like Chrome's own Contextual Tasks interface, which is dangerous because users trust that interface. Google Workspace exports are the downloadable or exportable forms of Google Docs, Sheets and similar files; if the attacker can read them, they can read the documents.
Limitations: the attack requires a signed-in Google account, and the private read requires a known Doc or Sheet ID. The report gives the example of an invite-only Chromium design document whose ID is exposed in the share URL, which a drive-by attack could expose. An invite-only document is one that has not been shared publicly; only specific people can open it. The ID being visible in the share URL means anyone who sees the link learns the ID, even if they cannot open the document directly.
Fix
The report does not describe the fix that was applied. The root cause points to the missing IsTrustedHost() validation on the chrome_host value taken from the stored creation URL, and to the renderer preferring the raw window.location parameter over the validated loadTimeData value.
Variants to test
These are ideas for finding similar bugs elsewhere. A variant is the same mistake appearing in a different place.
- Other WebUI features that accept a host or origin parameter from a search or AI Mode URL. A positive result is the parameter surviving into the privileged
chrome://URL and being used to rewrite a managed webview or iframe. - Renderer code that reads
window.locationbefore falling back toloadTimeData. A positive result is a value that bypasses the C++ validation and reaches a privileged sink. A sink is the place where a value finally gets used in a way that matters, such as being loaded as a page or sent to the browser process. postMessagebridges that updatetargetOrigin_from the committed guest origin. A positive result is a message from an attacker origin being forwarded to a Mojo handler that parses it as a privileged command.- URL loader factory interceptors that attach a bearer token for eligible destinations. A positive result is an attacker-controlled guest receiving the token on requests to those destinations.
- Known-ID private document reads through CORS-readable exports. A positive result is an HTTP 200 response containing the document contents, readable from attacker JavaScript.
Glossary
- Allowlist: a list of things that are explicitly permitted; everything not on the list is refused.
- AIM: the internal name for the AI Mode part of the Contextual Tasks feature.
AimToClientMessage: a binary message type that the AI Mode side sends to the client side of the browser.- Bearer token: a secret string sent with a request to prove the sender is authorised; whoever carries it is trusted.
- Bisect: a debugging technique that narrows down which code change introduced a bug by repeatedly testing the midpoint between a known-good and a known-bad version.
- Bridge: code that lets two separate parts of a system exchange messages.
- Browser process: Chrome's trusted core process, written in C++, which controls the whole browser.
- Chrome VRP: Google's Vulnerability Reward Program, which pays researchers for reporting security bugs in Chrome.
chrome://: the address prefix used by Chrome's own built-in, trusted pages.chrome_host: a URL parameter that tells the Contextual Tasks feature which host to load in its embedded guest.- Commit: the moment the browser decides which page is now the current one in a frame.
- Commit (source control): one recorded change to source code, identified by a long hash.
- Contextual Tasks: a Chrome feature that embeds a managed
<webview>inside the privilegedchrome://contextual-tasksWebUI. - CORS: Cross-Origin Resource Sharing, the browser rule that decides whether JavaScript on one origin may read a response from another origin.
- CVE: a public catalogue number for a known security vulnerability.
- Drive-by attack: an attack where the victim only has to visit a page, with no further interaction.
- Eligible Google requests: requests to Google addresses that the Contextual Tasks feature is willing to attach its token to.
- GN: the configuration language Chromium uses to describe how to build itself.
- Google Doc or Sheet ID: the long string in a Google Docs or Sheets address that identifies one specific document.
- Google Workspace exports: the downloadable or exportable forms of Google Docs, Sheets and similar files.
- Guest: the page shown inside a
<webview>. - Header: a labelled line of extra information sent with an HTTP request or response.
- Host: the page that contains a
<webview>; also, the machine or site part of a URL. - HTTP 200: the standard success status code returned by a web server when a request worked.
- Insufficient validation of untrusted input: a vulnerability class where data from an untrusted source is used without being checked first.
- Invite-only: a document that has not been shared publicly and can only be opened by specific people.
IsTrustedHost(): the existing allowlist check that decides whether a host is an approved Google origin.loadTimeData: a mechanism where trusted C++ code hands values to a page's JavaScript.- Loopback address:
[redacted], a special address that always means "this same computer". - Managed
<webview>: a<webview>whose behaviour, including which address it loads, is controlled by the host page. - Mojo: Chrome's internal messaging system that lets different parts of the browser talk to each other.
- Origin: the combination of scheme, host name and port that identifies where a page came from.
- Page handler: the C++ object on the trusted side that receives messages from a page.
- Patch: a small file describing changes to source code, applied before building.
- Port: a numbered door on a computer that a server listens on.
- Renderer process: the process that runs web pages; it is treated as untrusted.
- Sink: the place where a value finally gets used in a way that matters.
- Spoof: a fake designed to look real.
- URL loader factory interceptor: a hook in Chrome's networking layer that can inspect and modify outgoing requests.
- URL parameter: a small piece of data carried in a web address after a question mark.
- Variant: the same mistake appearing in a different place.
- WebUI: Chrome's internal, trusted pages at
chrome://addresses. <webview>: a way for one page to show another page inside a frame.