Inappropriate implementation in IME (CVE-2026-17975)
On macOS, the browser component that manages secure keyboard entry stopped protecting keystrokes once a password field was switched to a plain text field, because it only looked at the current input type and ignored the flag marking the field as having been a password field. A background keylogger or third-party input method with input-monitoring privileges could then capture the password as it was typed into the revealed field.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 58 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: RenderWidgetHostViewMac fails to check the TEXT_INPUT_FLAG_HAS_BEEN_PASSWORD flag when determining whether to keep secure event input enabled. When a password field is dynamically toggled to a text field (such as via a 'show password' button), secure input is deactivated. This potentially exposes sensitive password keystrokes to system-wide keyboard event taps and third-party input method editors (IMEs) on macOS.
Affected files:
content/browser/renderer_host/render_widget_host_view_mac.mm
Estimated timestamp from git blame: 2018-03-12
Root Cause
In content/browser/renderer_host/render_widget_host_view_mac.mm, SetTextInputActive manages the lifecycle of ui::ScopedPasswordInputEnabler, which wraps macOS's system-wide EnableSecureEventInput() security control. However, the decision to hold this enabler is based purely on the un-coerced text input type:
// content/browser/renderer_host/render_widget_host_view_mac.mm:1790-1800
void RenderWidgetHostViewMac::SetTextInputActive(bool active) {
const bool should_enable_password_input =
active && GetTextInputType() == ui::TEXT_INPUT_TYPE_PASSWORD;
if (should_enable_password_input) {
password_input_enabler_ =
std::make_unique<ui::ScopedPasswordInputEnabler>();
} else {
password_input_enabler_.reset();
}
update_windows_timer_.Stop();
}
// content/browser/renderer_host/render_widget_host_view_mac.mm:405-409
ui::TextInputType RenderWidgetHostViewMac::GetTextInputType() {
if (!GetActiveWidget())
return ui::TEXT_INPUT_TYPE_NONE;
return text_input_manager_->GetTextInputState()->type;
}
When a password input field's type attribute is dynamically toggled to 'text' (e.g., to reveal the password to the user), Blink correctly maintains the kWebTextInputFlagHasBeenPasswordField flag (ui::TEXT_INPUT_FLAG_HAS_BEEN_PASSWORD in the browser) to signal that the field contains sensitive credentials that should still be protected. This flag is set in third_party/blink/renderer/core/editing/ime/input_method_controller.cc:
if (auto* input = DynamicTo<HTMLInputElement>(element)) {
if (input->HasBeenPasswordField())
flags |= kWebTextInputFlagHasBeenPasswordField;
}
Unlike Chrome's Views counterpart (ui/views/cocoa/text_input_host.mm:247-258) or ui::InputMethodBase::GetTextInputType(), RenderWidgetHostViewMac does not consult this flag. As a result, when a password field is toggled, GetTextInputType() returns ui::TEXT_INPUT_TYPE_TEXT, evaluating should_enable_password_input to false. This triggers password_input_enabler_.reset(), disabling secure keyboard entry while the user is actively typing their password.
Potential Trigger Path
Note: These are suggested steps to replicate the behavior based on a code-level review, as our tooling does not have the capability to run code.
- Focus a password field on a web page (e.g.
<input type="password">). This triggersEnableSecureEventInput()viaScopedPasswordInputEnablerin the browser process. - Execute a script (or click a page element) that dynamically changes the input type to text:
inputElement.type = 'text'. This preserves theTEXT_INPUT_FLAG_HAS_BEEN_PASSWORDflag in the renderer'sTextInputStatebut changestypetoTEXT_INPUT_TYPE_TEXT. - Observe that
RenderWidgetHostViewMac::SetTextInputActivere-evaluates, sees the new type, and resetspassword_input_enabler_, actively callingDisableSecureEventInput()at the OS level while the user is still focused and typing.
Impact
This is a potential macOS-specific defense-in-depth bypass. When the secure event input protection is disabled, any background keyloggers (such as those using Carbon/Cocoa CGEventTap with accessibility/input-monitoring privileges) and third-party IMEs can capture the sensitive password keystrokes as the user types them into the revealed field.
Suggested Fix
Update RenderWidgetHostViewMac::SetTextInputActive to check for ui::TEXT_INPUT_FLAG_HAS_BEEN_PASSWORD when evaluating whether to enable secure password input, matching the approach used elsewhere in Chromium:
void RenderWidgetHostViewMac::SetTextInputActive(bool active) {
bool has_been_password = false;
if (text_input_manager_ && text_input_manager_->GetTextInputState()) {
has_been_password = (text_input_manager_->GetTextInputState()->flags &
ui::TEXT_INPUT_FLAG_HAS_BEEN_PASSWORD) != 0;
}
const bool should_enable_password_input =
active && (GetTextInputType() == ui::TEXT_INPUT_TYPE_PASSWORD || has_been_password);
...
Evaluated with Chrome root at commit: 87214e6721f6c34afd9181b80769a24c0c601c50
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 the secure-input decision in RenderWidgetHostViewMac checks only the current text input type and never consults the TEXT_INPUT_FLAG_HAS_BEEN_PASSWORD flag, unlike other Chromium code paths.
Impact
This is a potential macOS-specific defence-in-depth bypass: with secure event input off, background keyloggers and third-party input methods could capture the password keystrokes, though the text notes the steps are suggested from code review and were not run.
What the attacker needed
MacOS; victim focuses a password field; field is toggled to text; attacker has input-monitoring privileges
The fix
The fix should make SetTextInputActive also check the has-been-password flag when deciding whether to keep secure password input enabled.
How it was found
- Focus a password field on a web page, which enables secure event input.
- Change the field's type to text with a script or a page control, which keeps the has-been-password flag but changes the reported type.
- Observe that the browser re-evaluates and disables secure event input while the field is still focused.
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.
macOS has a system feature that tells the operating system to stop other programs from listening to the keyboard while you type a password. Chrome turns this on when you focus a password box, but turns it off if the page changes that box into an ordinary text box, for example with a 'show password' button. The report says this leaves your password keystrokes visible to any other program on the machine that is allowed to watch keyboard input.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.