Inappropriate implementation in Chrome for iOS (CVE-2026-17839)
A per-tab slot holding file-picker settings was only cleared when a navigation started, so the outgoing page could re-seed it during the provisional navigation window. The next page's file picker could then open with the attacker's MIME filters, camera setting and screen position instead of the victim's.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
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 cross-origin state contamination vulnerability in Chrome for iOS allows an outgoing page to re-seed the file picker event state during provisional navigation. When a newly loaded victim page subsequently triggers a file picker that bypasses the typescript hook, the browser consumes the attacker's spoofed attributes. This enables an attacker to potentially control file-picker attributes such as MIME filters, camera activation, and anchoring coordinates on behalf of the victim origin.
Affected files:
ios/chrome/browser/web/model/choose_file/choose_file_tab_helper.mmios/chrome/browser/web/model/choose_file/choose_file_java_script_feature.mmios/chrome/browser/file_upload_panel/coordinator/file_upload_panel_mediator.mmios/chrome/browser/web/model/choose_file/resources/choose_file.ts
Estimated timestamp from git blame: 2025-10-03
Root Cause Analysis
ChooseFileTabHelper maintains a single per-tab last_choose_file_event_ slot to pass configuration parameters (MIME types, file extensions, camera activation, and screen coordinate anchors) from the page-world JavaScript click handler to the native iOS file-picker coordinator.
However, this slot is only cleared at the start of navigation via DidStartNavigation:
void ChooseFileTabHelper::DidStartNavigation(
web::WebState* web_state,
web::NavigationContext* navigation_context) {
if (!navigation_context->IsSameDocument()) {
AbortSelection();
ResetLastChooseFileEvent();
}
}
On iOS, WebStateObserver::DidStartNavigation is dispatched when a provisional navigation starts (-webView:didStartProvisionalNavigation:). At this point, the outgoing document is still active and executing in the WKWebView until the navigation commits (-webView:didCommitNavigation:), which typically takes at least one network round-trip time (RTT).
During this provisional window, the outgoing (attacker) page can execute script and post messages directly to the registered ChooseFileHandler script message handler. Because ChooseFileJavaScriptFeature handles incoming script messages without checking if the frame is in a provisional state, the attacker can successfully re-seed the last_choose_file_event_ slot after the initial reset has occurred.
When the navigation finally commits and loads the victim page, the seeded last_choose_file_event_ remains in the slot. If the victim page subsequently opens its <input type=file> via a path that bypasses the page-world choose_file.ts hook (such as an input inside the Shadow DOM, HTMLInputElement.showPicker(), or when capture-phase event propagation is stopped), the victim does not overwrite the seeded event.
Consequently, when WebKit calls the open panel delegate, ChooseFileTabHelper::RunOpenPanel pops the attacker's event from the slot and ignores the trusted WKFrameInfo* frame argument, consuming the attacker-controlled accept_file_extensions, accept_mime_types, capture, and screen_location properties on behalf of the victim origin.
Downstream Impact
An attacker can potentially spoof the file-picker attributes presented on behalf of a victim origin, leading to native UI misrepresentation and origin confusion:
- Camera Enlistment/Hijacking: Force a full-screen camera view to open directly instead of the document/file picker, or vice-versa.
- Filter Manipulation: Restrict or expand the UTType filters shown in the native document picker (e.g. limiting the user's choice to certificate types like
.p12). - Coordinate Anchoring Spoofing: Position the native presentation popover/context menu at arbitrary screen coordinates (e.g. over the omnibox or other sensitive browser chrome) to aid in social engineering or clickjacking.
Suggested/Potential Exploitation Steps
(Note: These are potential steps; our tooling does not currently have the capability to run code or execute live proofs-of-concept on iOS)
-
The user visits an attacker-controlled page (
https://attacker.example). The page executes an interval to repeatedly post message events and navigates the tab to a victim page:JavaScript setInterval(() => { webkit.messageHandlers.ChooseFileHandler.postMessage({ acceptType: 0, hasMultiple: false, hasWebkitdirectory: false, hasSelectedFile: false, capture: 1, fileExtensions: '.p12', mimeTypes: 'application/x-pkcs12', screenLocation: { x: 200, y: 40 }, pointerType: 'touch' }); }, 20); location.href = 'https://victim.example/upload'; -
The web view initiates navigation and fires
didStartProvisionalNavigation:, which clearslast_choose_file_event_viaDidStartNavigationin the browser process. -
The attacker's interval fires again before the victim page commits, successfully writing the malicious properties back into
last_choose_file_event_via the script message handler. -
The victim page commits and opens its file input via a path that bypasses the hook (e.g., calling
input.showPicker()), leaving the attacker-seeded slot intact. -
The file picker opens using the attacker's properties, forcing the camera to open or restricting document selection to certificate files instead of those requested by the victim.
Suggested Fix
To remediate this issue, consider implementing the following protections:
- State Isolation: Instead of a single tab-wide
last_choose_file_event_slot, associate the seeded events with the specific frame/document ID that generated them, or validate that the origin of the frame passed viaWKFrameInfo* frameinRunOpenPanelstrictly matches the security origin of the frame that generated theChooseFileEvent. - Commit-time Clearance: Clear the
last_choose_file_event_slot on navigation commit (e.g. withinDidFinishNavigationorDidCommitNavigation) to ensure that state from a previous document is discarded upon loading a new document.
Evaluated with Chrome root at commit: fb72408a8493c46bc75fae1c70d03daec96b3040
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 a single per-tab state slot is reset only at navigation start and the script message handler does not check whether the frame is mid-navigation, so the outgoing document can overwrite it before commit.
Impact
An attacker could potentially misrepresent the native file picker on behalf of a victim origin, forcing a camera view, restricting the selectable file types, or anchoring the picker over browser chrome; the report notes no live proof-of-concept was run.
What the attacker needed
Victim visits an attacker-controlled page; victim page opens a file input bypassing the hook; iOS Chrome
The fix
The report suggests binding stored events to the originating frame or document and validating the frame origin, and clearing the slot when navigation commits.
How it was found
- The attacker page repeatedly posts file-picker settings to the browser's script message handler and then navigates the tab to a victim page.
- The navigation starts and the browser clears the stored file-picker event.
- Before the victim page commits, the attacker's repeated messages write the spoofed settings back into the slot.
- The victim page commits and opens its file input through a path that skips the page-world hook, so the seeded event is not overwritten.
- The file picker opens using the attacker's settings, such as forcing the camera or limiting selection to certificate files.
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 a page opens a file chooser, the browser stores some settings for it, such as which file types are allowed. This report says those settings were kept in one shared place per tab and were only wiped when a new page started loading, not when it finished. So the old page could sneak its own settings back in while the new page was still loading, and the new page's file chooser would then use them.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.