Skip to content
XSS Advisory Advanced CVE-2026-17761

Insufficient validation of untrusted input in Chrome for iOS (CVE-2026-17761)

The session restoration code on Chrome for iOS builds a WebKit interaction state blob from synced navigation items without checking URL schemes, so a synced javascript: URL can end up in the browser history. When the victim navigates back or forward to that entry, WebKit runs the script in the context of the current origin, giving a potential universal cross-site scripting issue.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 3 months

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 without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: The session restoration process on iOS constructs a WKWebView interactionState blob without sanitizing URLs in the NavigationItem. This allows an attacker to sync a malicious javascript: URL into a victim's history. When the victim navigates to this history entry, the JavaScript executes in the context of the current origin, leading to a potential Universal Cross-Site Scripting (UXSS) vulnerability.

Affected files:

  • ios/web/navigation/synthesized_session_restore.mm
  • ios/web/navigation/navigation_manager_impl.mm

Estimated timestamp from git blame: 2021-11-18

Description

A potential Universal Cross-Site Scripting (UXSS) vulnerability exists in the session restoration mechanism of Chrome for iOS. The vulnerability stems from a lack of URL validation when constructing the WKWebView interactionState binary blob from synced session data.

The function SynthesizedSessionRestore in ios/web/navigation/synthesized_session_restore.mm creates the session state blob from a list of NavigationItem objects. It directly injects the URL string into the kEntryURL and kEntryOriginalURL properties of the state dictionary without verifying that the scheme is safe (e.g., restricting to HTTP/HTTPS/File):

OBJECTIVEC
    [entries addObject:@{
      kEntryData : entry_data.AsNSData(),
      kEntryOriginalURL : base::SysUTF8ToNSString(item->GetURL().spec()),
      kEntryExternalURLPolicy : external_url_policy,
      kEntryTitle : base::SysUTF16ToNSString(item->GetTitle()),
      kEntryURL : base::SysUTF8ToNSString(item->GetURL().spec()),
    }];

This data ultimately originates from components/sync_sessions/synced_session.cc where SessionNavigationFromSyncData accepts URLs from the sync protobuf without rejecting javascript: schemes. Consequently, an attacker can sync a malicious session containing a javascript: URL.

When NavigationManagerImpl::Restore calls SynthesizedSessionRestore, the resulting blob is passed to [WKWebView setInteractionState:]. WebKit implicitly trusts the contents of this blob and populates its native history stack with the javascript: entry.

If a user opens the restored tab and performs a back/forward navigation to the malicious entry, WebKit executes the javascript: URL in the context of the currently loaded origin. Because this is a history navigation handled internally by WebKit as a script execution, it bypasses Chrome's CRWWKNavigationHandler::decidePolicyForNavigationAction delegate, which normally blocks javascript: navigations.

Potential Attack Steps

Note: These steps are based on static analysis; a working Proof of Concept has not been verified dynamically.

  1. An attacker constructs a malicious sync_pb::SessionSpecifics payload containing a tab with two history entries: a legitimate target URL (e.g., https://example.com) and an adjacent javascript: URL (e.g., javascript:alert(document.domain)).
  2. The attacker syncs this payload to their Chrome account and tricks the victim into signing in, or compromises the victim's account to inject the payload.
  3. The victim's iOS Chrome instance pulls down the synced session data.
  4. The victim navigates to "Recent Tabs" and opens the synced tab.
  5. The tab loads the legitimate URL, establishing the active document context.
  6. The victim interacts with the app by swiping back or clicking the back/forward button, triggering a navigation to the malicious history entry.
  7. WebKit executes the injected JavaScript within the context of the legitimate origin, completing the UXSS.

Suggested Fix

Sanitize URLs before encoding them into the interactionState blob. In SynthesizedSessionRestore, verify that item->GetURL().SchemeIsHTTPOrHTTPS() or use a broader allowlist of safe schemes (e.g., about:blank, chrome://). If a URL contains an unsafe scheme like javascript:, the entry should either be omitted from the restoration payload or the URL should be neutralized.

Evaluated with Chrome root at commit: cc901875d53bf4e4fe0e01f02843871da4106e70


Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; 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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 session restore code copies synced URLs into WebKit's interaction state without restricting them to safe schemes such as HTTP or HTTPS.

Impact

A victim who opens a synced tab and navigates back to the malicious entry could have attacker JavaScript run in the context of the legitimate site, potentially leading to universal cross-site scripting; the report notes this is based on static analysis and no working proof of concept was verified.

What the attacker needed

Chrome for iOS with sync enabled; attacker can inject synced session data; victim opens the synced tab; victim navigates back or forward

The fix

The report suggests sanitising URLs before they are encoded into the interaction state blob, allowing only safe schemes and dropping or neutralising entries with unsafe schemes.

How it was found

  1. The attacker creates a synced session payload with a normal site and an adjacent javascript: history entry.
  2. The attacker gets the payload into the victim's Chrome sync, by tricking them into signing in or by compromising the account.
  3. The victim's iOS Chrome downloads the synced session data.
  4. The victim opens the synced tab from Recent Tabs, loading the normal site.
  5. The victim swipes back or uses back/forward, which triggers the malicious history entry.
  6. WebKit runs the injected script in the context of the normal site.

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.

Chrome can sync your open tabs between devices. This report says the iOS version trusted the web addresses stored in that synced data too much. If one of those addresses was a special javascript: link, opening the restored tab and going back to it could run attacker code on whatever site was showing, which is dangerous because it crosses site boundaries.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.