Skip to content
XSS Advisory Advanced CVE-2026-11205

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

The iOS QR scanner's validation to block javascript: URLs can be bypassed with a Unicode ideographic space, because GURL and the Omnibox parser handle whitespace differently. An attacker could craft a QR code that executes arbitrary JavaScript in the context of the currently active website.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 42 days

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 go/chrome-ai-generated-security-bugs-faq for more information.

Overview: The iOS QR scanner's validation to prevent javascript: and restricted scheme execution can be bypassed using an Ideographic Space character (U+3000). A parser differential between GURL and AutocompleteInput allows an attacker-controlled QR code to execute arbitrary JavaScript in the context of the currently active website.

Affected files:

  • ios/chrome/browser/qr_scanner/ui/qr_scanner_view_controller.mm

Estimated timestamp from git blame: 2021-03-03

The iOS QR Scanner (ios/chrome/browser/qr_scanner/ui/qr_scanner_view_controller.mm) contains a security mechanism to prevent a scanned string from automatically executing javascript: or navigating to sensitive chrome:// URLs. The implementation parses the string using GURL and, if it is valid but not HTTP/HTTPS, mitigates the threat by wrapping the string in double quotes before passing it to the Omnibox. This forces the Omnibox to treat the payload as a web search rather than a URL.

However, this defense relies on the assumption that GURL and the Omnibox's URL parser (AutocompleteInput) handle leading whitespace consistently. They do not:

  1. GURL uses ShouldTrimFromUrl (url/url_parse_internal.h), which only strips ASCII whitespace characters (<= 0x20). It fails to strip the Unicode Ideographic Space (U+3000). Consequently, a payload like " javascript:alert(1)" fails scheme extraction in GURL because the non-ASCII character makes the scheme invalid. url.is_valid() returns false, so the mitigation is skipped and the string remains unquoted.
  2. The unquoted string is then programmatically inserted into the Omnibox. Because the insertion is programmatic, it bypasses the omnibox::SanitizeTextForPaste check (which normally strips javascript: schemas on paste).
  3. When the user taps "Go", AutocompleteInput::Init (components/omnibox/browser/autocomplete_input.cc) processes the string. It calls base::TrimWhitespace with base::kWhitespaceUTF16, which explicitly includes U+3000. The Ideographic Space is cleanly stripped, leaving a valid javascript: URL.
  4. The Omnibox executes the JavaScript payload in the context of the currently active WebState, resulting in a Universal Cross-Site Scripting (UXSS) vulnerability.

Potential Attack Scenario

  1. An attacker crafts a malicious QR code containing " javascript:alert(document.cookie)".
  2. The victim navigates to a sensitive site (e.g., their bank) in Chrome for iOS.
  3. The victim opens the Chrome QR scanner and scans the malicious code.
  4. The scanner fills the Omnibox with the unquoted string. The victim taps the "Go" button on the keyboard.
  5. The payload executes in the context of the bank's origin.

Suggested Fix

Ensure that the QR scanner's sanitization process aggressively trims all Unicode whitespace before validating the URL with GURL. Additionally, receiveQRScannerResult:loadImmediately: should wrap the result in quotes if the URL is invalid but appears to contain a restricted scheme, or if it is unable to be cleanly validated.

Evaluated with Chrome root at commit: 4a3e9db74111a3c6c4b3acfd70050a05077cf27a


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

The QR scanner's validation uses GURL, which only strips ASCII whitespace, while the Omnibox's AutocompleteInput strips Unicode whitespace including U+3000, so a leading ideographic space hides the javascript: scheme from validation but is removed before execution.

Impact

An attacker could execute arbitrary JavaScript in the context of the currently active website, leading to Universal Cross-Site Scripting (UXSS).

What the attacker needed

Victim uses Chrome for iOS; victim scans a malicious QR code; victim taps 'Go' after scanning

The fix

The QR scanner's sanitisation should aggressively trim all Unicode whitespace before validating the URL with GURL, and should wrap the result in quotes if the URL is invalid but appears to contain a restricted scheme.

How it was found

  1. An attacker crafts a malicious QR code containing a javascript: payload prefixed with an ideographic space.
  2. The victim navigates to a sensitive site in Chrome for iOS.
  3. The victim opens the Chrome QR scanner and scans the malicious code.
  4. The scanner fills the Omnibox with the unquoted string.
  5. The victim taps the 'Go' button on the keyboard.
  6. The payload executes in the context of the bank's origin.

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.

A QR code scanner in Chrome for iOS tries to stop dangerous links that start with 'javascript:' from running code. But it checks the link using one method that ignores a special invisible space character, while the address bar later removes that space and treats the link as real code. So a malicious QR code can run code on whatever website the user is currently viewing.

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.