Insufficient validation of untrusted input in Chrome for iOS (CVE-2026-13917)
iOS Chrome built file:// URLs for downloaded files by concatenating the raw path without percent-escaping, so a double-URL-encoded filename could survive sanitisation and be decoded by WKWebView into a path traversal. An attacker who convinces a user to download and open such a file could make the browser display arbitrary files from the app sandbox.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 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: iOS Chrome's download manager insecurely constructs file:// URLs from downloaded file paths without proper escaping. An attacker can provide a double-URL-encoded filename to bypass initial sanitization and trigger a path traversal when the URL is decoded by WKWebView. This could potentially allow an attacker to trick a user into viewing arbitrary internal files from the application sandbox.
Affected files:
ios/chrome/browser/download/coordinator/download_manager_coordinator.mm
Estimated timestamp from git blame: Unknown (Google3 checkout)
Description
A potential vulnerability exists in iOS Chrome's DownloadManagerCoordinator where it constructs URLs for downloaded files. When a user chooses to open a downloaded file, the application creates a GURL by concatenating the file:// scheme directly with the raw file path string using base::StringPrintf.
Because the raw path string is not properly percent-escaped, an attacker can embed URL-encoded traversal sequences (like %2e%2e%2f) into the filename. When this GURL is later converted to an NSURL and loaded by WKWebView, the underlying iOS frameworks automatically percent-decode the path. This resolves the traversal sequences, allowing the web view to escape the Downloads directory and load arbitrary files from the application's sandbox (e.g., Library/Preferences/com.google.chrome.ios.plist).
Suggested Attacker Steps
Note: These are suggested/potential steps based on static code analysis. Our tooling agent does not currently have the ability to run code or verify the exploit end-to-end.
- Serve Malicious Download: An attacker hosts a file with a double-URL-encoded
Content-Dispositionheader, such as:Content-Disposition: attachment; filename="%252e%252e%252fLibrary%252fPreferences%252fcom.google.chrome.ios.plist" - Sanitization Bypass: During download,
net::GenerateFileNameunescapes%25to%, resulting in%2e%2e%2f.... Because the iOS Chrome filesystem sanitization functions only check for literal slashes (/) and dots (.), this percent-encoded string is considered valid and the file is saved literally as%2e%2e%2f...in theDownloadsdirectory. - User Interaction: The user taps "Open" in the iOS Chrome download UI.
- Insecure URL Construction: In
ios/chrome/browser/download/coordinator/download_manager_coordinator.mm, theopenDownloadedFileForDownloadManagerViewController:method constructs aGURLdirectly from the raw string without escaping it:GURL filePathURL = GURL(base::StringPrintf("%s://%s", "file", path.value().c_str())); - Security Check Bypass: A
virtualFilePathURLis created using thechrome://downloads/scheme. WhenCRWWebRequestControllerintercepts the navigation, it allows it becauseweb::GetWebClient()->IsAppSpecificURL(virtualURL)returns true forchrome://URLs. - Path Traversal Execution:
CRWWebRequestControllerconverts theGURLto anNSURLand calls[-WKWebView loadFileRequest:allowingReadAccessToURL:], passing the traversal URL for both arguments.NSURLpercent-decodes%2fto/and%2eto.. The OS resolves the..sequences, escaping theDownloadsfolder, and exposes the target internal file to the user in a new tab.
Impact
This is a localized sandbox logic bypass resulting in information disclosure. If an attacker can convince a user to download and open a file, they can force the browser to display sensitive internal application files (like local preferences, cookies, or databases) to the user.
Suggested Fix
Update openDownloadedFileForDownloadManagerViewController: to construct the GURL using net::FilePathToFileURL(path) instead of base::StringPrintf.
net::FilePathToFileURL safely percent-escapes characters like % to %25. This ensures that when NSURL later decodes the path, it decodes %25 back to % rather than interpreting %2e%2e%2f as a directory traversal sequence.
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.
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 download manager concatenated the raw file path into a file:// URL without percent-escaping it, so encoded traversal sequences survived sanitisation and were decoded by NSURL/WKWebView.
Impact
If an attacker can convince a user to download and open a file, they could force the browser to display sensitive internal application files such as preferences, cookies or databases; the report notes this is a potential issue from static analysis and was not verified end-to-end.
What the attacker needed
Victim downloads a malicious file; victim taps Open on the download; iOS Chrome
The fix
The download manager should build the file URL with net::FilePathToFileURL so that percent signs are escaped and cannot be decoded into traversal sequences.
How it was found
- The attacker hosts a file whose Content-Disposition filename is double-URL-encoded to contain traversal sequences.
- During download, net::GenerateFileName unescapes %25 to %, leaving percent-encoded traversal that the iOS filesystem sanitisation accepts because it only checks literal slashes and dots.
- The user taps Open in the iOS Chrome download UI.
- The download manager builds a GURL by concatenating file:// with the raw path without escaping.
- A chrome://downloads/ virtual URL passes the app-specific URL check in CRWWebRequestController.
- CRWWebRequestController converts the GURL to an NSURL and loads it in WKWebView, which percent-decodes the path and resolves the traversal out of the Downloads folder.
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 open a downloaded file, the app turns its name into a web address. If the name contains encoded dots and slashes, the app fails to escape them, and the web view later decodes them into a path that climbs out of the downloads folder. This lets a malicious file name make the browser show internal app files to the user.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.