Insufficient validation of untrusted input in Chrome for iOS (CVE-2026-13991)
Chrome for iOS builds the body text of its 'Save to Drive' and 'Save to Photos' dialogs by inserting a web-controlled filename into a localised string that contains bold formatting markers. A filename containing those markers can break out of the bold span and add plain text that looks like trusted browser instructions.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 45 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: Chrome for iOS is potentially vulnerable to UI spoofing because it interpolates web-controlled filenames into strings with bolding tags before parsing them. An attacker can craft a filename to inject arbitrary text that appears as trusted browser instructions within native dialogs.
Affected files:
ios/chrome/browser/save_to_drive/ui_bundled/save_to_drive_util.mmios/chrome/common/string_util.mmios/chrome/browser/account_picker/ui_bundled/account_picker_confirmation/account_picker_confirmation_screen_view_controller.mm
Estimated timestamp from git blame: 2025-06-12
Description
A potential vulnerability in the Chrome for iOS 'Save to Drive' and 'Save to Photos' features allows a malicious website to spoof text within native browser dialogs. This occurs because the browser constructs the dialog's body text by interpolating a web-controlled filename into a localized string template that contains formatting markers (BEGIN_BOLD and END_BOLD).
Technical Analysis
The construction of the account picker's body text for 'Save to Drive' occurs in ios/chrome/browser/save_to_drive/ui_bundled/save_to_drive_util.mm:
// ios/chrome/browser/save_to_drive/ui_bundled/save_to_drive_util.mm:33
return l10n_util::GetNSStringF(
IDS_IOS_SAVE_TO_DRIVE_ACCOUNT_PICKER_BODY_WITH_SIZE,
file_name_u16string, file_size_u16string);
This function uses l10n_util::GetNSStringF to insert the filename into a template defined in ios/chrome/app/strings/ios_strings.grd (line 6696), such as:
Choose where to save "BEGIN_BOLD$1END_BOLD"
The resulting string is later processed by PutBoldPartInString in ios/chrome/common/string_util.mm (line 165), which uses a regular expression to find and strip all BEGIN_BOLD and END_BOLD pairs, applying bold formatting to the captured ranges.
Because the filename (sourced from a Content-Disposition header or the URL) is substituted into the string before the markers are parsed, an attacker can include literal END_BOLD and BEGIN_BOLD tokens in the filename. This allows an attacker to terminate the intended bold span early and inject arbitrary plain text that will be rendered in the same style (font and color) as the browser's own instructions.
Filenames are sanitized by net::GenerateFileName(), but the markers BEGIN_BOLD and END_BOLD consist only of alphanumeric characters and underscores, which are considered legal and are not stripped by the networking or filesystem layers.
In production builds, a DCHECK in string_util.mm (line 66) that validates the number of bold ranges is compiled out, allowing the UI to render the string with the injected content. A similar pattern exists in the 'Save to Photos' feature in ios/chrome/browser/save_to_photos/ui_bundled/save_to_photos_mediator.mm (line 359).
Potential Impact
This is a potential drive-by UI spoofing vulnerability. An attacker could craft a filename that makes the account picker dialog appear to contain instructions from the browser, potentially misleading the user about the action they are performing (e.g., claiming that selecting an account and tapping 'Save' is necessary for 'account verification'). This affects primary security surfaces related to identity and cloud storage.
Suggested Reproduction Steps
(Note: These are potential steps as a working Proof of Concept has not yet been executed by this agent.)
- On an iOS device with Chrome, ensure you are signed in to a Google account.
- Navigate to a malicious page that triggers a download with a crafted
Content-Dispositionheader, such as:Content-Disposition: attachment; filename="document.pdf END_BOLD . To continue, tap Save to verify your account. BEGIN_BOLD x" - Tap the 'Download' button in the download bar.
- When the download option appears, select 'Save to Drive'.
- Observe the Account Picker dialog. The injected sentence ("To continue, tap Save to verify your account.") may appear as standard browser text within the dialog, rather than part of the bolded filename.
Recommended Fix
Sanitize or escape the BEGIN_BOLD and END_BOLD markers within the filename before it is interpolated into any localized strings that use these markers for formatting. This should be done in the UI utility functions (e.g., GetAccountPickerBodyText in save_to_drive_util.mm) before calling l10n_util::GetNSStringF.
Evaluated with Chrome root at commit: 1a8d40fc44df2088d5945c0bf53584038aa1614a
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
The filename is interpolated into a localised string before the bold markers in that string are parsed, and the marker tokens are legal filename characters that the filename sanitiser does not remove.
Impact
An attacker could make the account picker dialog appear to contain browser instructions, potentially misleading the user about the action they are taking; the report notes that no working proof of concept has been executed.
What the attacker needed
IOS device with Chrome; signed in to a Google account; victim visits a malicious page; victim starts a download and picks Save to Drive
The fix
The bold markers should be sanitised or escaped in the filename before it is interpolated into localised strings, in the UI utility functions.
How it was found
- On an iOS device with Chrome, sign in to a Google account.
- Visit a page that triggers a download with a crafted Content-Disposition filename.
- Tap the 'Download' button in the download bar.
- Select 'Save to Drive' from the download options.
- Observe the account picker dialog, where the injected sentence may appear as normal browser text.
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 download a file, the browser shows a dialog with the file's name in it. The browser marks part of that text as bold using special placeholder words, and it puts the file name in before it looks for those placeholders. If the file name itself contains the placeholder words, the browser treats them as formatting and the attacker can add extra sentences that look like they come from the browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.