Skip to content
Info disclosure Advisory Advanced CVE-2026-78975

Incorrect authorization in DOM (CVE-2026-78975)

A logic flaw in Blink's focus handling lets a script-focused element be re-marked as user-gesture-focused when the tab or window regains focus. This could let a malicious page trigger spell-checking on arbitrary text and leak the user's custom dictionary through side channels.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 3 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: Blink's focus handling contains a logic flaw where a script-focused element's state can be laundered into a user-gesture-focused state. When a tab or window loses and regains focus, page focus events update the element with FocusType::kPage, which incorrectly overrides the gesture tracking flag. This potentially allows a malicious page to programmatically trigger spell-checking on arbitrary text and leak the user's custom dictionary via side channels.

Affected files:

  • third_party/blink/renderer/core/dom/element.cc
  • third_party/blink/renderer/core/page/focus_controller.cc
  • third_party/blink/renderer/core/editing/spellcheck/idle_spell_check_controller.cc

Estimated timestamp from git blame: 2025-10-23

Summary

There is a potential security bypass of the user-dictionary-leaks protection gate in Blink. When an element is focused programmatically by a script, WasLastFocusFromUserGesture is initially set to false. However, if the page loses and regains window focus, the page-level focus controller restores focus to the active element using FocusType::kPage. This transition incorrectly updates WasLastFocusFromUserGesture to true, laundering the script-focused state. An attacker can potentially exploit this to programmatically trigger spell-checking on arbitrary text ranges without direct user interaction, bypassing the protections designed to prevent custom dictionary leaks.

Root Cause Analysis

In third_party/blink/renderer/core/dom/element.cc (lines 8389-8392), Element::SetFocused determines if the last focus transition originated from a user gesture by excluding only kNone and kScript:

C++
void Element::SetFocused(bool now_focused, mojom::blink::FocusType focus_type) {
  EnsureRareData().SetWasLastFocusFromUserGesture(
      focus_type != mojom::blink::FocusType::kNone &&
      focus_type != mojom::blink::FocusType::kScript);

However, mojom::blink::FocusType::kPage represents page focus restoration (e.g., when regaining window or tab focus). Under this logic, FocusType::kPage evaluates to true, which asserts WasLastFocusFromUserGesture = true on the focused element.

In third_party/blink/renderer/core/page/focus_controller.cc, when page-level focus is lost or gained, DispatchEventsOnWindowAndFocusedElement invokes SetFocused on the currently focused element using FocusType::kPage:

  • Unfocusing: focused_element->SetFocused(false, mojom::blink::FocusType::kPage); (line 1143)
  • Focusing: focused_element->SetFocused(true, mojom::blink::FocusType::kPage); (line 1157)

This sequence overrides the original script-focused (kScript) state and marks the element as gesture-focused, bypassing the safety gate in IdleSpellCheckController::RespondToChangedSelection (in third_party/blink/renderer/core/editing/spellcheck/idle_spell_check_controller.cc lines 128-132).

Potential Attack Steps

(Note: These are potential steps as our tooling does not yet have the ability to execute code and verify them on a live system.)

  1. Serve an HTML page containing an editable element with candidate words:

    HTML
    <div id="probe" contenteditable spellcheck="true">word1 word2 word3</div>
    
  2. Programmatically focus the element on load: probe.focus(). This sets WasLastFocusFromUserGesture to false.

  3. Wait for the user to switch tabs or minimize/restore the window. When the page loses and regains focus, page focus events update the element with FocusType::kPage, laundering WasLastFocusFromUserGesture to true.

  4. Programmatically move the selection caret over candidate words (e.g., using getSelection().collapse(...)).

  5. Because WasLastFocusFromUserGesture is now true, RespondToChangedSelection does not deactivate. It schedules hot-mode spell-checking, ultimately submitting the words to the spelling engine.

  6. Detect the spellcheck results via side channels (such as timing differences in processing or platform autocorrect indicators) to extract the private contents of the user's custom dictionary.

Suggested Fix

Do not update the WasLastFocusFromUserGesture flag when the focus type is mojom::blink::FocusType::kPage. This preserves the element's original programmatic or gesture-focused source during tab/window focus cycles. Modify Element::SetFocused in third_party/blink/renderer/core/dom/element.cc as follows:

C++
void Element::SetFocused(bool now_focused, mojom::blink::FocusType focus_type) {
  if (focus_type != mojom::blink::FocusType::kPage) {
    EnsureRareData().SetWasLastFocusFromUserGesture(
        focus_type != mojom::blink::FocusType::kNone &&
        focus_type != mojom::blink::FocusType::kScript);
  }
  ...

Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8


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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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

Element::SetFocused treats every focus type other than kNone and kScript as a user gesture, so page-level focus restoration (kPage) wrongly sets the gesture flag to true.

Impact

An attacker could potentially leak the private contents of the user's custom dictionary, though the report notes the steps are unverified and rely on side channels.

What the attacker needed

Victim visits a malicious page; victim switches tabs or minimises window; custom dictionary populated

The fix

Element::SetFocused should not update the gesture flag when the focus type is kPage, preserving the original focus source across tab and window focus cycles.

How it was found

  1. Serve a page with an editable element containing candidate words and spellcheck enabled.
  2. Focus the element from script on load, which marks it as not gesture-focused.
  3. Wait for the user to switch tabs or minimise and restore the window so page focus is restored.
  4. Move the selection caret over candidate words from script.
  5. Spell-checking is scheduled because the gesture flag is now true.
  6. Detect spell-check results through side channels to infer the custom dictionary contents.

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.

Browsers try to only run certain sensitive actions, like spell-checking, when the user has actually interacted with the page. This report says a page can trick the browser into thinking the user did interact, just by losing and regaining focus, which may let it probe the user's personal spelling dictionary.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.