Skip to content
Race condition Advisory Advanced CVE-2026-87641

Race condition in Browser (CVE-2026-87641)

A logic error in the media stream permission bubble means a user's choice to block camera or microphone access is only applied when the bubble closes, using the current page's settings. If the page navigates while the bubble is open, the block is silently discarded and the site keeps its access.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 3 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: A logic error in the media stream permission bubble allows a site to prevent a user from revoking camera or microphone access. If the site triggers a cross-document navigation while the bubble is open, the browser's revocation logic executes against the new page state, silently discarding the user's explicit intent to block permissions.

Affected files:

  • chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Estimated timestamp from git blame: 2023-07-19

Summary

The ContentSettingMediaStreamBubbleModel manages the omnibox permission bubble for Camera and Microphone access. A potential vulnerability exists because the user's decision to "Block" access is not applied immediately; it is deferred until the bubble closes via CommitChanges(). However, CommitChanges() fetches the page state using GetPage().GetMainDocument(), which refers to the current primary page of the associated WebContents.

If a cross-document navigation commits while the bubble is open, the WebContentsObserver::PrimaryPageChanged event fires, causing the bubble to close synchronously. During the destruction sequence, CommitChanges() is invoked, but GetPage() now points to the newly committed page. Because the new page has not yet requested media streams, its PageSpecificContentSettings has an empty media_stream_access_origin. This causes CommitChanges() to hit an early return, entirely skipping the code that updates the user's content settings.

Potential Attack Scenario

An attacker who has already been granted Camera/Microphone access could use this to maintain persistent access despite explicit user intervention to revoke it. (Note: These are suggested steps based on static analysis; our tooling cannot run live code).

  1. The user grants Camera/Mic permissions to https://attacker.com.
  2. The malicious page listens for the window.onblur event. When the user clicks the omnibox media indicator, the permission bubble steals focus, triggering the event.
  3. The malicious page reacts to onblur by initiating a delayed cross-document navigation (e.g., location.href = '/delayed_response').
  4. The user clicks the radio button to "Block" the camera/microphone.
  5. Before the user clicks "Done" or closes the bubble manually, the delayed navigation commits.
  6. The browser invokes WebContentsImpl::DidCommitNavigation and updates the primary page.
  7. WebContentsObserver::PrimaryPageChanged is fired. ContentSettingBubbleContents receives this and calls GetWidget()->Close() to dismiss the bubble since the page changed.
  8. The widget destruction sequence calls ContentSettingBubbleContents::WindowClosing(), which invokes content_setting_bubble_model_->CommitChanges().
  9. CommitChanges() calls PageSpecificContentSettings::GetForFrame(&GetPage().GetMainDocument()). This retrieves the settings for the new page.
  10. The code evaluates if (content_settings->media_stream_access_origin().is_empty()). Since the new page hasn't accessed media, this is true.
  11. The function returns early. UpdateSettings() is never called, and the user's intent to revoke the permission is silently discarded.

Code Reference

In chrome/browser/ui/content_settings/content_setting_bubble_model.cc:

C++
void ContentSettingMediaStreamBubbleModel::CommitChanges() {
  PageSpecificContentSettings* content_settings =
      PageSpecificContentSettings::GetForFrame(&GetPage().GetMainDocument());
  // ...
  if (content_settings->media_stream_access_origin().is_empty()) {
    return; // <--- Early return hit because of the new page state
  }
  // ...
  if (!ShouldShowSystemMediaPermissions()) {
    if (selected_item() != bubble_content().radio_group.default_item) {
      UpdateSettings(radio_item_setting_[selected_item()]); // <--- Revocation is skipped
    }
  }
}

Suggested Fix

Instead of querying PageSpecificContentSettings::GetForFrame(&GetPage().GetMainDocument()) during CommitChanges(), the ContentSettingMediaStreamBubbleModel should cache the media_stream_access_origin (or the specific url to be modified) when the model is constructed. This ensures that the user's action is applied to the origin that was actively using the media stream when the bubble was opened, regardless of subsequent navigations.

Evaluated with Chrome root at commit: 2155cb00003ec35716a76ed3246eae995f87b7ff


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

Likely the bubble applies the user's choice at close time by looking up the current main page's settings instead of remembering the origin that was shown when the bubble opened, so a navigation makes it act on the wrong page and return early.

Impact

A site that already holds camera or microphone permission could keep that access even after the user explicitly blocks it, though the report notes the steps come from static analysis and were not run.

What the attacker needed

Site already has camera/mic permission; user opens the permission bubble; site navigates while bubble is open; user picks Block before navigation commits

The fix

The model should remember the media stream origin when it is created and apply the user's choice to that origin, rather than looking up the current page when the bubble closes.

How it was found

  1. The user grants camera and microphone permission to the attacker's site.
  2. The site watches for the window losing focus, which happens when the permission bubble opens.
  3. On losing focus, the site starts a delayed navigation to another page.
  4. The user selects the option to block the camera or microphone.
  5. The delayed navigation commits before the user closes the bubble, so the bubble closes automatically.
  6. The close handler applies the choice against the new page, finds no media origin, and returns early, so the block is never saved.

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 click the camera or microphone icon in the address bar, a small pop-up lets you allow or block access. This report says that if the website loads a new page while that pop-up is open, your choice to block is thrown away and the site keeps its access. The site has to already have permission and has to notice the pop-up taking focus, so it is not something any random page can do.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.