Race in Chrome for iOS (CVE-2026-17724)
A race condition in Chrome for iOS allows a malicious bookmarklet to execute on a different origin than intended. An attacker could flood the IPC channel to delay navigation state updates, causing the UI-side URL check to pass on stale data while the WebContent process has already navigated to a sensitive site, leading to Universal XSS.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 46 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 potential Time-of-Check to Time-of-Use (TOCTOU) vulnerability exists in iOS Chrome's handling of bookmarklet execution. By initiating a cross-origin navigation while flooding the IPC channel, an attacker could bypass UI-side URL security checks. This could result in malicious JavaScript being evaluated on a newly navigated sensitive origin, leading to Universal Cross-Site Scripting (UXSS).
Affected files:
ios/web/js_messaging/web_view_js_utils.mmios/chrome/browser/url_loading/model/url_loading_util.mmios/web/web_state/ui/crw_web_controller.mmios/web/navigation/navigation_manager_impl.mm
Estimated timestamp from git blame: Unknown (Google3 checkout)
Description
A potential Time-of-Check to Time-of-Use (TOCTOU) race condition exists in the implementation of LoadJavaScriptURL on iOS. When a user triggers a bookmarklet, Chrome performs URL verification in the UI process to ensure the script executes on the intended page. For example, BookmarksCoordinator checks that activeWebState->GetLastCommittedURL() matches the expected URL before dismissal.
However, the actual execution ultimately relies on the legacy [WKWebView evaluateJavaScript:completionHandler:] API in ios/web/js_messaging/web_view_js_utils.mm. This specific API is not frame-bound. If a navigation commits in the WebContent process after Chrome dispatches the execution request but before WebKit evaluates it, the script will execute in the context of the newly committed page.
An attacker can widen this race window significantly by flooding the UI process with IPC messages (e.g., via window.webkit.messageHandlers). This delays the UI process from receiving navigation commit events, causing the UI-side security checks to pass on stale state data, while the WebContent process has already moved to a new origin.
Suggested Exploit Steps
- The attacker hosts a malicious website (
attacker.com) and socially engineers the user into saving a malicious bookmarklet in Chrome Bookmarks. - The user navigates to
attacker.comand opens the Bookmarks menu. - Triggered by a UI event (like
blurwhen the menu opens),attacker.cominitiates a renderer-side navigation to a sensitive target (e.g.,mail.google.com). - Immediately,
attacker.combegins flooding the WebKit IPC channel (e.g., rapidly callingpostMessage) to delay state updates to the Chrome UI process. - The navigation to
mail.google.comcommits in the background WebContent process. - The user selects the malicious bookmarklet.
- The Chrome UI process checks if the current URL matches
attacker.com. Because the IPC commit messages are delayed by the flood, the check passes using stale data. - Chrome calls
ExecuteUserJavaScript, which sends an IPC via the unbound[WKWebView evaluateJavaScript:completionHandler:]API. - The WebContent process receives the execution request and runs the malicious script on the currently active document, which is now
mail.google.com, resulting in UXSS.
Note: These are suggested steps; our tooling has not executed a working proof of concept to verify the reliability of the IPC flood in this specific context.
Suggested Fix
The root cause is the use of the legacy, non-frame-bound evaluateJavaScript:completionHandler: API in web::ExecuteJavaScript (specifically the 4-argument overload in ios/web/js_messaging/web_view_js_utils.mm).
The fix should involve migrating calls that execute user-provided JavaScript (like bookmarklets) to use the modern, frame-bound API: [WKWebView evaluateJavaScript:inFrame:inContentWorld:completionHandler:]. By passing a valid WKFrameInfo corresponding to the expected state, WebKit will guarantee that the script execution is dropped if the frame has navigated to a different webpage, effectively neutralizing the race condition.
Evaluated with Chrome root at commit: 65b3256311f3ab6fb9870eaa522de7e6dd2663bb
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 use of a non-frame-bound JavaScript evaluation API that does not verify the frame's current origin at execution time.
Impact
This could result in Universal Cross-Site Scripting, allowing malicious JavaScript to run on a sensitive origin, but the report notes that no working proof of concept has been executed to verify the reliability of the IPC flood.
What the attacker needed
Victim saves a malicious bookmarklet; victim visits attacker's site; victim opens bookmarks menu; attacker can flood IPC channel
How it was found
- The attacker hosts a malicious website and tricks the user into saving a malicious bookmarklet.
- The user visits the attacker's site and opens the bookmarks menu.
- The attacker's site starts a navigation to a sensitive target.
- The attacker's site floods the IPC channel to delay state updates.
- The navigation to the sensitive target commits in the background.
- The user selects the malicious bookmarklet, which executes on the sensitive target.
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 you click a bookmarklet, Chrome checks the current website's address before running the script. This report suggests that if an attacker floods Chrome with messages, the check might use an old address while the page has already changed to a sensitive site like your email. The script could then run on that sensitive site, letting the attacker steal data or act as you.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.