Missing authorization in iOSWebView (CVE-2026-113246)
The CWVAutofillController in ios/web_view updates its active frame state on any form activity event, including gestureless form_changed events. A cross-origin iframe can trigger such an event to poison the state, causing subsequent field navigation commands to be misdirected to the attacker's iframe, potentially allowing keystroke interception.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 4 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: CWVAutofillController unconditionally updates its active frame state upon receiving any form activity event, including gestureless 'form_changed' events. A cross-origin iframe can exploit this by mutating its DOM to trigger a 'form_changed' event, silently poisoning the controller's internal state. Subsequent field navigation commands (like 'Next Field') from the embedding application will then be misdirected to the attacker's iframe, allowing potential keystroke interception.
Affected files:
ios/web_view/internal/autofill/cwv_autofill_controller.mm
Estimated timestamp from git blame: Unknown (Google3 checkout)
Description
A potential vulnerability exists in CWVAutofillController (part of the ios/web_view API) that allows a cross-origin iframe to hijack focus by poisoning the controller's internal state. This occurs because the controller updates its tracking of the active frame before validating the type of form activity event it has received.
In ios/web_view/internal/autofill/cwv_autofill_controller.mm, the method -webState:didRegisterFormActivity:inFrame: handles form activity notifications from the renderer process. It unconditionally updates several state variables, most notably _lastFormActivityWebFrameID, using the frame provided in the callback:
- (void)webState:(web::WebState*)webState
didRegisterFormActivity:(const autofill::FormActivityParams&)params
inFrame:(web::WebFrame*)frame {
// ...
std::string frame_id = frame ? frame->GetFrameId() : "";
// ...
_lastFormActivityWebFrameID = frame_id; // Updated unconditionally
// ...
if (params.type == "focus") { ... }
else if (params.type == "input" || params.type == "keyup") { ... }
// ...
}
One type of activity event is form_changed, which is generated automatically by a MutationObserver in the renderer when DOM mutations occur on form elements. This event does not require a user gesture.
Because the state update happens before checking the event type, an attacker-controlled cross-origin iframe can trigger this event to overwrite _lastFormActivityWebFrameID with its own frame ID at any time.
Impact
The _lastFormActivityWebFrameID variable is relied upon by the following methods to determine which frame should receive focus navigation commands:
focusPreviousFieldfocusNextFieldcheckIfPreviousAndNextFieldsAreAvailableForFocusWithCompletionHandler:
If a third-party iOS application embedding Chromium via ios/web_view provides UI (such as 'Next' or 'Previous' buttons in a keyboard accessory) that calls these methods, the commands will be directed to the attacker's iframe instead of the user's intended frame. This results in cross-origin focus hijacking. A user, believing they are still typing into the top-level form, would inadvertently type their sensitive information directly into the attacker's frame.
Potential Exploit Steps
Note: These are suggested steps based on code analysis; our tooling agent does not have the ability to run active exploit code.
- An attacker hosts a malicious page loaded as a cross-origin iframe within a legitimate site or app view.
- The user focuses a legitimate input field in the top-level frame. This correctly sets
_lastFormActivityWebFrameIDto the top-level frame. - The embedding application displays a keyboard accessory with a "Next" button.
- The attacker's iframe executes JavaScript to mutate its DOM (e.g.,
document.body.appendChild(document.createElement('input'))). - This mutation triggers a gestureless
form_changedevent sent from the renderer to the browser process. CWVAutofillControllerreceives the event and unconditionally overwrites_lastFormActivityWebFrameIDwith the attacker's frame ID.- The user taps the "Next" button on the app's UI.
- The app calls
[CWVAutofillController focusNextField], which uses the poisoned_lastFormActivityWebFrameIDto send focus into the attacker's iframe. - The attacker's JavaScript captures subsequent keystrokes via standard
inputorkeydownevent listeners.
Recommended Fix
Modify -webState:didRegisterFormActivity:inFrame: in cwv_autofill_controller.mm to explicitly ignore form_changed events when updating active frame state, or move the state assignments inside the conditional blocks that check for user-initiated events (focus, input, etc.).
// Ignore form_changed events to prevent gestureless form changes from
// overwriting the active target web frame ID.
if (params.type == "form_changed") {
return;
}
_lastFormActivityWebFrameID = frame_id;
// ...
(A similar fix was previously implemented in FormInputAccessoryMediator).
Evaluated with Chrome root at commit: 65b3256311f3ab6fb9870eaa522de7e6dd2663bb
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 controller updates its active frame state before checking the type of form activity event, so gestureless form_changed events can overwrite the state.
Impact
If a third-party iOS application embedding Chromium via ios/web_view provides UI that calls focus navigation methods, commands could be directed to the attacker's iframe, resulting in cross-origin focus hijacking and potential keystroke interception.
What the attacker needed
Attacker-controlled cross-origin iframe; embedding app uses ios/web_view focus methods; user interacts with keyboard accessory
The fix
The method should ignore form_changed events when updating active frame state, or move the state assignments inside conditional blocks for user-initiated events.
How it was found
- An attacker hosts a malicious page loaded as a cross-origin iframe within a legitimate site or app view.
- The user focuses a legitimate input field in the top-level frame, setting the active frame ID correctly.
- The embedding application displays a keyboard accessory with a 'Next' button.
- The attacker's iframe mutates its DOM to trigger a gestureless form_changed event.
- The controller overwrites the active frame ID with the attacker's frame ID.
- The user taps 'Next', and focus is sent to the attacker's iframe, which captures keystrokes.
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.
This is about a part of Chromium's iOS web view that helps apps move between form fields. A malicious website embedded in another page can trick that component into thinking the user is typing in the malicious site, so when the user taps 'Next', their typing goes to the attacker instead of the real form.
What is UI spoofing?
The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.